Class: OMQ::CHANNEL

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

Overview

Exclusive 1-to-1 bidirectional socket (ZeroMQ RFC 52).

Allows exactly one peer connection. Both sides can send and receive.

Instance Method Summary collapse

Constructor Details

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

Creates a new CHANNEL 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/channel.rb', line 17

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