Class: OMQ::XSUB
- Defined in:
- lib/omq/pub_sub.rb
Overview
XSUB socket — like SUB but subscriptions are sent as data frames.
Constant Summary
Constants included from Writable
Instance Attribute Summary
Attributes inherited from Socket
#engine, #last_tcp_port, #options
Instance Method Summary collapse
-
#initialize(endpoints = nil, linger: Float::INFINITY, send_hwm: nil, recv_hwm: nil, send_timeout: nil, recv_timeout: nil, subscribe: nil, on_mute: :block, backend: nil, &block) ⇒ XSUB
constructor
A new instance of XSUB.
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, #last_endpoint, #monitor, #peer_connected, #reconnect_enabled=, #set_unbounded, #stop, #subscriber_joined, #unbind
Constructor Details
#initialize(endpoints = nil, linger: Float::INFINITY, send_hwm: nil, recv_hwm: nil, send_timeout: nil, recv_timeout: nil, subscribe: nil, on_mute: :block, backend: nil, &block) ⇒ XSUB
Returns a new instance of XSUB.
127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/omq/pub_sub.rb', line 127 def initialize(endpoints = nil, linger: Float::INFINITY, send_hwm: nil, recv_hwm: nil, send_timeout: nil, recv_timeout: nil, subscribe: nil, on_mute: :block, backend: nil, &block) init_engine(:XSUB, send_hwm: send_hwm, recv_hwm: recv_hwm, send_timeout: send_timeout, recv_timeout: recv_timeout, on_mute: on_mute, backend: backend) @options.linger = linger attach_endpoints(endpoints, default: :connect) send("\x01#{subscribe}".b) unless subscribe.nil? finalize_init(&block) end |