Class: RFlow::Broker

Inherits:
ChildProcess show all
Defined in:
lib/rflow/broker.rb

Overview

A message broker process to mediate messages along a connection. The broker runs in a child process and will not return from ChildProcess#spawn!.

Direct Known Subclasses

Connections::ZMQStreamer

Constant Summary

Constants inherited from ChildProcess

ChildProcess::SIGINFO

Instance Attribute Summary

Attributes inherited from ChildProcess

#name, #pid

Class Method Summary collapse

Methods inherited from ChildProcess

#initialize, #shutdown!, #spawn!

Constructor Details

This class inherits a constructor from RFlow::ChildProcess

Class Method Details

.build(config) ⇒ RFlow::Connections::ZMQStreamer

Build the broker from the connection configuration. Only supports Configuration::ZMQStreamer configurations.

Parameters:

Returns:



12
13
14
15
16
17
18
19
# File 'lib/rflow/broker.rb', line 12

def build(config)
  case config.class.name
  when 'RFlow::Configuration::ZMQStreamer'
    RFlow::Connections::ZMQStreamer.new(config)
  else
    raise ArgumentError, 'Only ZMQ brokers currently supported'
  end
end