Class: OMQ::PULL

Inherits:
Socket show all
Includes:
Readable
Defined in:
lib/omq/push_pull.rb

Overview

PULL socket — receive messages from PUSH peers via fair-queue.

Instance Attribute Summary

Attributes inherited from Socket

#engine, #last_tcp_port, #options

Instance Method Summary collapse

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, #last_endpoint, #monitor, #peer_connected, #reconnect_enabled=, #set_unbounded, #stop, #subscriber_joined, #unbind

Constructor Details

#initialize(endpoints = nil, recv_hwm: nil, recv_timeout: nil, backend: nil, &block) ⇒ PULL

Returns a new instance of PULL.

Parameters:

  • endpoints (String, nil) (defaults to: nil)

    endpoint to bind/connect

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

    receive high water mark (nil uses default)

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

    receive timeout in seconds

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

    :ruby (default) or :ffi



35
36
37
38
39
# File 'lib/omq/push_pull.rb', line 35

def initialize(endpoints = nil, recv_hwm: nil, recv_timeout: nil, backend: nil, &block)
  init_engine(:PULL, recv_hwm: recv_hwm, recv_timeout: recv_timeout, backend: backend)
  attach_endpoints(endpoints, default: :bind)
  finalize_init(&block)
end