Class: Invoker::IPC::BaseCommand
- Inherits:
-
Object
- Object
- Invoker::IPC::BaseCommand
- Defined in:
- lib/invoker/ipc/base_command.rb
Direct Known Subclasses
AddCommand, AddHttpCommand, DnsCheckCommand, ListCommand, PingCommand, ReloadCommand, RemoveCommand, TailCommand
Instance Attribute Summary collapse
-
#client_socket ⇒ Object
Returns the value of attribute client_socket.
Instance Method Summary collapse
-
#initialize(client_socket) ⇒ BaseCommand
constructor
A new instance of BaseCommand.
-
#run_command(message_object) ⇒ Boolean
Invoke the command that actual processes incoming message returning true from this message means, command has been processed and client socket can be closed.
- #send_data(message_object) ⇒ Object
Constructor Details
#initialize(client_socket) ⇒ BaseCommand
Returns a new instance of BaseCommand.
5 6 7 |
# File 'lib/invoker/ipc/base_command.rb', line 5 def initialize(client_socket) @client_socket = client_socket end |
Instance Attribute Details
#client_socket ⇒ Object
Returns the value of attribute client_socket.
4 5 6 |
# File 'lib/invoker/ipc/base_command.rb', line 4 def client_socket @client_socket end |
Instance Method Details
#run_command(message_object) ⇒ Boolean
Invoke the command that actual processes incoming message returning true from this message means, command has been processed and client socket can be closed. returning false means, it is a long running command and socket should not be closed immediately
19 20 21 |
# File 'lib/invoker/ipc/base_command.rb', line 19 def run_command() raise "Not implemented" end |
#send_data(message_object) ⇒ Object
9 10 11 |
# File 'lib/invoker/ipc/base_command.rb', line 9 def send_data() client_socket.write(.) end |