Class: Falcon::Command::Supervisor

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/falcon/command/supervisor.rb

Overview

Implements the ‘falcon supervisor` command.

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

Defined Under Namespace

Classes: Metrics, Restart

Instance Method Summary collapse

Instance Method Details

#callObject

Connect to the supervisor and execute the requested command.



64
65
66
67
68
69
70
71
72
# File 'lib/falcon/command/supervisor.rb', line 64

def call
	Async do
		endpoint.connect do |socket|
			stream = Async::IO::Stream.new(socket)
			
			@command.call(stream)
		end
	end
end

#command=(value) ⇒ Object

The nested command to execute.



53
54
55
56
# File 'lib/falcon/command/supervisor.rb', line 53

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

#endpointObject

The endpoint the supervisor is bound to.



59
60
61
# File 'lib/falcon/command/supervisor.rb', line 59

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