Class: RFlow::Configuration::BrokeredZMQConnection

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

Overview

STI Subclass 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.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Connection

#all_required_options_present?, #merge_default_options!, required_options

Methods included from UUIDKeyed

included

Class Method Details

.default_optionsObject



77
78
79
80
81
82
83
84
85
86
# File 'lib/rflow/configuration/connection.rb', line 77

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

#brokersObject

A brokered ZMQ connection requires one broker process.



89
90
91
# File 'lib/rflow/configuration/connection.rb', line 89

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