Class: OMQ::CLIENT

Inherits:
Socket
  • Object
show all
Includes:
Readable, SingleFrame, Writable
Defined in:
lib/omq/client_server.rb

Overview

Asynchronous client socket for the CLIENT/SERVER pattern (ZeroMQ RFC 41).

Round-robins outgoing messages across connected SERVER peers.

Instance Method Summary collapse

Constructor Details

#initialize(endpoints = nil, linger: Float::INFINITY, backend: nil) ⇒ CLIENT

Creates a new CLIENT 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)

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

    optional transport backend



17
18
19
20
21
# File 'lib/omq/client_server.rb', line 17

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