Class: EZMQ::Client
Overview
Request socket that sends messages and receives replies.
Instance Attribute Summary
Attributes inherited from Socket
#context, #decode, #encode, #socket
Instance Method Summary collapse
-
#initialize(**options) ⇒ Client
constructor
Creates a new Client socket.
-
#request(message = '', **options) ⇒ void
Sends a message and waits to receive a response.
Methods inherited from Socket
#connect, #listen, #receive, #send
Constructor Details
#initialize(**options) ⇒ Client
Creates a new Client socket.
14 15 16 |
# File 'lib/ezmq/request.rb', line 14 def initialize(**) super :connect, ZMQ::REQ, end |
Instance Method Details
#request(message = '', **options) ⇒ void
This method returns an undefined value.
Sends a message and waits to receive a response.
27 28 29 30 31 32 33 34 |
# File 'lib/ezmq/request.rb', line 27 def request( = '', **) send , if block_given? yield receive else receive end end |