Class: OMQ::GATHER

Inherits:
Socket show all
Includes:
Readable, SingleFrame
Defined in:
lib/omq/scatter_gather.rb

Overview

Pipeline receiver socket that fair-queues from SCATTER peers (ZeroMQ RFC 49).

Instance Attribute Summary

Attributes inherited from Socket

#engine, #options

Instance Method Summary collapse

Methods included from SingleFrame

#send

Methods included from Readable

#receive, #wait_readable

Methods included from QueueReadable

#dequeue, #each, #wait

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, recv_hwm: nil, recv_timeout: nil, backend: nil) ⇒ GATHER

Creates a new GATHER socket.

Parameters:

  • endpoints (String, Array<String>, nil) (defaults to: nil)

    endpoint(s) to bind to

  • linger (Numeric) (defaults to: Float::INFINITY)

    linger period in seconds (Float::INFINITY = wait forever, 0 = drop)

  • recv_hwm (Integer, nil) (defaults to: nil)

    receive high-water mark

  • recv_timeout (Integer, nil) (defaults to: nil)

    receive timeout in seconds

  • backend (Object, nil) (defaults to: nil)

    optional transport backend



46
47
48
49
50
# File 'lib/omq/scatter_gather.rb', line 46

def initialize(endpoints = nil, linger: Float::INFINITY, recv_hwm: nil, recv_timeout: nil, backend: nil)
  init_engine(:GATHER, recv_hwm: recv_hwm, recv_timeout: recv_timeout, backend: backend)
  @options.linger = linger
  attach_endpoints(endpoints, default: :bind)
end