Class: OMQ::DISH
- Includes:
- Readable
- Defined in:
- lib/omq/radio_dish.rb
Overview
Group-based subscriber socket (ZeroMQ RFC 48).
Receives messages from RADIO peers for joined groups. Supports both TCP and UDP transports.
Instance Attribute Summary
Attributes inherited from Socket
Instance Method Summary collapse
-
#initialize(endpoints = nil, linger: Float::INFINITY, group: nil, on_mute: :block, backend: nil) ⇒ DISH
constructor
Creates a new DISH socket.
-
#join(group) ⇒ void
Joins a group.
-
#leave(group) ⇒ void
Leaves a group.
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, group: nil, on_mute: :block, backend: nil) ⇒ DISH
Creates a new DISH socket.
91 92 93 94 95 96 |
# File 'lib/omq/radio_dish.rb', line 91 def initialize(endpoints = nil, linger: Float::INFINITY, group: nil, on_mute: :block, backend: nil) init_engine(:DISH, on_mute: on_mute, backend: backend) @options.linger = linger attach_endpoints(endpoints, default: :connect) join(group) if group end |
Instance Method Details
#join(group) ⇒ void
This method returns an undefined value.
Joins a group.
104 105 106 |
# File 'lib/omq/radio_dish.rb', line 104 def join(group) @engine.routing.join(group) end |
#leave(group) ⇒ void
This method returns an undefined value.
Leaves a group.
114 115 116 |
# File 'lib/omq/radio_dish.rb', line 114 def leave(group) @engine.routing.leave(group) end |