Class: OMQ::Routing::Scatter
- Inherits:
-
Object
- Object
- OMQ::Routing::Scatter
- Includes:
- RoundRobin
- Defined in:
- lib/omq/routing/scatter.rb
Overview
SCATTER socket routing: round-robin send to GATHER peers.
Constant Summary
Constants included from RoundRobin
RoundRobin::BATCH_BYTE_CAP, RoundRobin::BATCH_MSG_CAP
Instance Method Summary collapse
- #connection_added(connection) ⇒ Object
- #connection_removed(connection) ⇒ Object
- #dequeue_recv ⇒ Object
- #enqueue(parts) ⇒ Object
-
#initialize(engine) ⇒ Scatter
constructor
A new instance of Scatter.
-
#recv_queue ⇒ Object
SCATTER is write-only.
-
#unblock_recv ⇒ Object
No-op; SCATTER has no recv queue to unblock.
Methods included from RoundRobin
Constructor Details
#initialize(engine) ⇒ Scatter
Returns a new instance of Scatter.
12 13 14 15 |
# File 'lib/omq/routing/scatter.rb', line 12 def initialize(engine) @engine = engine init_round_robin(engine) end |
Instance Method Details
#connection_added(connection) ⇒ Object
38 39 40 41 42 |
# File 'lib/omq/routing/scatter.rb', line 38 def connection_added(connection) @connections << connection add_round_robin_send_connection(connection) start_reaper(connection) end |
#connection_removed(connection) ⇒ Object
47 48 49 50 |
# File 'lib/omq/routing/scatter.rb', line 47 def connection_removed(connection) @connections.delete(connection) remove_round_robin_send_connection(connection) end |
#dequeue_recv ⇒ Object
25 26 27 |
# File 'lib/omq/routing/scatter.rb', line 25 def dequeue_recv raise "SCATTER sockets cannot receive" end |
#enqueue(parts) ⇒ Object
55 56 57 |
# File 'lib/omq/routing/scatter.rb', line 55 def enqueue(parts) enqueue_round_robin(parts) end |
#recv_queue ⇒ Object
SCATTER is write-only.
20 21 22 |
# File 'lib/omq/routing/scatter.rb', line 20 def recv_queue raise "SCATTER sockets cannot receive" end |
#unblock_recv ⇒ Object
No-op; SCATTER has no recv queue to unblock.
32 33 |
# File 'lib/omq/routing/scatter.rb', line 32 def unblock_recv end |