Method: RPC::Clients::Socket#send
- Defined in:
- lib/rpc/lib/rpc/clients/socket.rb
#send(data) ⇒ Object
TODO: support for notifications, probably refactor send to: def send(encoder, data)
binary = encoder.encode(data)
@client.puts(binary)
@client.readline if data[:id]
end … and don’t forget to add support for notifications to the example socket server!
39 40 41 42 43 |
# File 'lib/rpc/lib/rpc/clients/socket.rb', line 39 def send(data) @client.puts(data) @client.readline # TODO: sync vs. async: @socket.read or a callback and a loop end |