Class: Kaisoku::Daemon::Client
- Inherits:
-
Object
- Object
- Kaisoku::Daemon::Client
- Defined in:
- lib/kaisoku/daemon/client.rb
Instance Method Summary collapse
-
#initialize(socket_path:) ⇒ Client
constructor
A new instance of Client.
- #request(argv) ⇒ Object
Constructor Details
#initialize(socket_path:) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/kaisoku/daemon/client.rb', line 9 def initialize(socket_path:) @socket_path = socket_path end |
Instance Method Details
#request(argv) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/kaisoku/daemon/client.rb', line 13 def request(argv) UNIXSocket.open(@socket_path) do |socket| socket.write(MessagePack.pack('argv' => argv)) socket.close_write MessagePack.unpack(socket.read) end end |