Class: RFlow::Configuration::BrokeredZMQConnection

Inherits:
Connection show all
Defined in:
lib/rflow/configuration/connection.rb

Overview

Subclass of Connection for brokered ZMQ connections and their required options.

We name the IPCs to resemble a quasi-component. Outputting to this connection goes to the in of the IPC pair. Reading input from this connection comes from the out of the IPC pair.

The broker shuttles messages between the two to support the many-to-many delivery pattern.

Instance Attribute Summary

Attributes inherited from Connection

#input_port, #options, #output_port

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Connection

required_options

Class Method Details

.default_optionsObject

Default ZeroMQ options required for broker connection.



99
100
101
102
103
104
105
106
107
108
# File 'lib/rflow/configuration/connection.rb', line 99

def self.default_options
  {
    'output_socket_type'    => 'PUSH',
    'output_address'        => lambda{|conn| "ipc://rflow.#{conn.uuid}.in"},
    'output_responsibility' => 'connect',
    'input_socket_type'     => 'PULL',
    'input_address'         => lambda{|conn| "ipc://rflow.#{conn.uuid}.out"},
    'input_responsibility'  => 'connect',
  }
end

Instance Method Details

#brokersArray<Broker>

A brokered ZMQ connection requires one broker process.

Returns:



112
113
114
# File 'lib/rflow/configuration/connection.rb', line 112

def brokers
  @brokers ||= [ZMQStreamer.new(self)]
end