Class: OMQ::SERVER
- Includes:
- Readable, SingleFrame, Writable
- Defined in:
- lib/omq/client_server.rb
Overview
Asynchronous server socket for the CLIENT/SERVER pattern (ZeroMQ RFC 41).
Assigns a 4-byte routing ID to each connected CLIENT and supports directed replies via #send_to.
Instance Attribute Summary
Attributes inherited from Socket
Instance Method Summary collapse
-
#initialize(endpoints = nil, linger: Float::INFINITY, backend: nil) ⇒ SERVER
constructor
Creates a new SERVER socket.
-
#send_to(routing_id, message) ⇒ self
Sends a message to a specific peer by routing ID.
Methods included from SingleFrame
Methods included from Writable
Methods included from QueueWritable
Methods included from Readable
Methods included from QueueReadable
Methods inherited from Socket
#all_peers_gone, #attach_endpoints, bind, #bind, #close, #close_read, connect, #connect, #connection_count, #disconnect, #finalize_init, #init_engine, #inspect, #monitor, #peer_connected, #reconnect_enabled=, #set_unbounded, #stop, #subscriber_joined, #unbind
Constructor Details
#initialize(endpoints = nil, linger: Float::INFINITY, backend: nil) ⇒ SERVER
Creates a new SERVER socket.
49 50 51 52 53 |
# File 'lib/omq/client_server.rb', line 49 def initialize(endpoints = nil, linger: Float::INFINITY, backend: nil) init_engine(:SERVER, backend: backend) @options.linger = linger attach_endpoints(endpoints, default: :bind) end |