Class: OMQ::SCATTER

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

Overview

Pipeline sender socket that round-robins to GATHER 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 Writable

#<<, #send, #wait_writable

Methods included from QueueWritable

#enqueue

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, send_hwm: nil, send_timeout: nil, backend: nil) ⇒ SCATTER

Creates a new SCATTER socket.

Parameters:

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

    endpoint(s) to connect to

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

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

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

    send high-water mark

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

    send timeout in seconds

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

    optional transport backend



26
27
28
29
30
# File 'lib/omq/scatter_gather.rb', line 26

def initialize(endpoints = nil, linger: Float::INFINITY, send_hwm: nil, send_timeout: nil, backend: nil)
  init_engine(:SCATTER, send_hwm: send_hwm, send_timeout: send_timeout, backend: backend)
  @options.linger = linger
  attach_endpoints(endpoints, default: :connect)
end