Falcon SourceFalconCommandSupervisor

class Supervisor

Implements the falcon supervisor command.

Talks to an instance of the supervisor to issue commands and print results.

Nested

Definitions

options { ... }

The command line options.

Signature

attribute Samovar::Options

Implementation

options do
	option "--path <path>", "The control IPC path.", default: "supervisor.ipc"
end

nested

The nested command to execute.

Signature

attribute Command

Implementation

nested :command, {
	'restart' => Restart,
	'metrics' => Metrics,
}, default: 'metrics'

def endpoint

The endpoint the supervisor is bound to.

Implementation

def endpoint
	::IO::Endpoint.unix(@options[:path])
end

def call

Connect to the supervisor and execute the requested command.

Implementation

def call
	Sync do
		endpoint.connect do |socket|
			@command.call(IO::Stream(socket))
		end
	end
end