Class: NNQ::PULL0

Inherits:
Socket show all
Defined in:
lib/nnq/push_pull.rb

Overview

PULL side of the pipeline pattern (nng pull0). Fair-queues messages from all live PUSH peers into one unbounded receive queue. Defaults to listening.

Instance Attribute Summary

Attributes inherited from Socket

#options

Instance Method Summary collapse

Methods inherited from Socket

#all_peers_gone, bind, #bind, #close, #close_read, connect, #connect, #connection_count, #frozen_binary, #initialize, #last_endpoint, #monitor, #peer_connected, #raw?, #reconnect_enabled, #reconnect_enabled=

Constructor Details

This class inherits a constructor from NNQ::Socket

Instance Method Details

#receiveObject



38
39
40
41
42
43
44
45
46
# File 'lib/nnq/push_pull.rb', line 38

def receive
  Reactor.run do
    if (timeout = @engine.options.read_timeout)
      Fiber.scheduler.with_timeout(timeout) { @engine.routing.receive }
    else
      @engine.routing.receive
    end
  end
end