Class: OMQ::Routing::Pull
- Inherits:
-
Object
- Object
- OMQ::Routing::Pull
- Includes:
- FairRecv
- Defined in:
- lib/omq/routing/pull.rb
Overview
PULL socket routing: fair-queue receive from PUSH peers.
Instance Attribute Summary collapse
- #recv_queue ⇒ FairQueue readonly
Instance Method Summary collapse
- #connection_added(connection) ⇒ Object
- #connection_removed(connection) ⇒ Object
-
#enqueue(_parts) ⇒ Object
PULL is read-only.
-
#initialize(engine) ⇒ Pull
constructor
A new instance of Pull.
-
#stop ⇒ void
Stops all background tasks.
Methods included from FairRecv
Constructor Details
Instance Attribute Details
#recv_queue ⇒ FairQueue (readonly)
22 23 24 |
# File 'lib/omq/routing/pull.rb', line 22 def recv_queue @recv_queue end |
Instance Method Details
#connection_added(connection) ⇒ Object
27 28 29 |
# File 'lib/omq/routing/pull.rb', line 27 def connection_added(connection) add_fair_recv_connection(connection) end |
#connection_removed(connection) ⇒ Object
34 35 36 37 |
# File 'lib/omq/routing/pull.rb', line 34 def connection_removed(connection) @recv_queue.remove_queue(connection) # recv pump stops on EOFError end |
#enqueue(_parts) ⇒ Object
PULL is read-only.
42 43 44 |
# File 'lib/omq/routing/pull.rb', line 42 def enqueue(_parts) raise "PULL sockets cannot send" end |
#stop ⇒ void
This method returns an undefined value.
Stops all background tasks.
51 52 53 54 |
# File 'lib/omq/routing/pull.rb', line 51 def stop @tasks.each(&:stop) @tasks.clear end |