Class: Einhorn::Client
- Inherits:
-
Object
- Object
- Einhorn::Client
- Defined in:
- lib/einhorn/client.rb
Defined Under Namespace
Modules: Transport
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(socket) ⇒ Client
constructor
A new instance of Client.
- #receive_message ⇒ Object
- #send_command(command_hash) ⇒ Object
Constructor Details
#initialize(socket) ⇒ Client
Returns a new instance of Client.
45 46 47 |
# File 'lib/einhorn/client.rb', line 45 def initialize(socket) @socket = socket end |
Class Method Details
.for_fd(fileno) ⇒ Object
40 41 42 43 |
# File 'lib/einhorn/client.rb', line 40 def self.for_fd(fileno) socket = UNIXSocket.for_fd(fileno) self.new(socket) end |
.for_path(path_to_socket) ⇒ Object
35 36 37 38 |
# File 'lib/einhorn/client.rb', line 35 def self.for_path(path_to_socket) socket = UNIXSocket.open(path_to_socket) self.new(socket) end |
Instance Method Details
#close ⇒ Object
57 58 59 |
# File 'lib/einhorn/client.rb', line 57 def close @socket.close end |
#receive_message ⇒ Object
53 54 55 |
# File 'lib/einhorn/client.rb', line 53 def Transport.(@socket) end |
#send_command(command_hash) ⇒ Object
49 50 51 |
# File 'lib/einhorn/client.rb', line 49 def send_command(command_hash) Transport.(@socket, command_hash) end |