Class: Klay::Client::Ipc
- Inherits:
-
Klay::Client
- Object
- Klay::Client
- Klay::Client::Ipc
- Defined in:
- lib/klay/client/ipc.rb
Overview
Provides an IPC-RPC client.
Instance Attribute Summary collapse
-
#path ⇒ Object
The path of the IPC socket.
Instance Method Summary collapse
-
#initialize(path) ⇒ Ipc
constructor
Constructor for the IPC Client.
-
#send(payload) ⇒ String
Sends an RPC request to the connected IPC socket.
Constructor Details
#initialize(path) ⇒ Ipc
Constructor for the IPC Client. Should not be used; use Klay::Client.create intead.
30 31 32 33 |
# File 'lib/klay/client/ipc.rb', line 30 def initialize(path) super @path = path end |
Instance Attribute Details
#path ⇒ Object
The path of the IPC socket.
24 25 26 |
# File 'lib/klay/client/ipc.rb', line 24 def path @path end |
Instance Method Details
#send(payload) ⇒ String
Sends an RPC request to the connected IPC socket.
39 40 41 42 43 44 45 |
# File 'lib/klay/client/ipc.rb', line 39 def send(payload) socket = UNIXSocket.new(@path) socket.puts(payload) read = socket.recvmsg(nil)[0] socket.close return read end |