Class: RFlow

Inherits:
Object
  • Object
show all
Includes:
Log4r
Defined in:
lib/rflow.rb,
lib/rflow/shard.rb,
lib/rflow/broker.rb,
lib/rflow/logger.rb,
lib/rflow/master.rb,
lib/rflow/message.rb,
lib/rflow/version.rb,
lib/rflow/pid_file.rb,
lib/rflow/component.rb,
lib/rflow/connection.rb,
lib/rflow/child_process.rb,
lib/rflow/configuration.rb,
lib/rflow/component/port.rb,
lib/rflow/components/log.rb,
lib/rflow/components/raw.rb,
lib/rflow/daemon_process.rb,
lib/rflow/components/clock.rb,
lib/rflow/components/integer.rb,
lib/rflow/configuration/port.rb,
lib/rflow/configuration/shard.rb,
lib/rflow/components/replicate.rb,
lib/rflow/configuration/setting.rb,
lib/rflow/configuration/component.rb,
lib/rflow/configuration/connection.rb,
lib/rflow/configuration/uuid_keyed.rb,
lib/rflow/connections/zmq_connection.rb,
lib/rflow/components/ruby_proc_filter.rb

Overview

The RFlow application.

Defined Under Namespace

Modules: Components, Connections Classes: Avro, Broker, ChildProcess, Component, Configuration, Connection, DaemonProcess, ForwardToInputPort, ForwardToOutputPort, Logger, Master, Message, MessageCollectingConnection, PIDFile, Shard

Constant Summary collapse

VERSION =

The gem version.

'1.3.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationRFlow::Configuration (readonly)

RFlow’s configuration.



25
26
27
# File 'lib/rflow.rb', line 25

def configuration
  @configuration
end

.loggerRFlow::Logger

RFlow’s logger, whose message will be routed to logs as specified in the configuration.

Returns:



21
22
23
# File 'lib/rflow.rb', line 21

def logger
  @logger
end

.masterRFlow::Master (readonly)

RFlow’s master node which oversees all the others.

Returns:



29
30
31
# File 'lib/rflow.rb', line 29

def master
  @master
end

Class Method Details

.run!(config_database_path = nil, daemonize = false) ⇒ Object

Start RFlow running. This is the main programmatic entry point to the application. Pulls in the configuration, sets up logging, and starts the master note.

Parameters:

  • config_database_path (String) (defaults to: nil)

    the path to the SQLite configuration database

  • daemonize (boolean) (defaults to: false)

    true to fork and daemonize; false to run in the foreground



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rflow.rb', line 39

def self.run!(config_database_path = nil, daemonize = false)
  @config_database_path = config_database_path
  @daemonize = daemonize

  establish_configuration
  chdir_application_directory
  setup_logger
  start_master_node
rescue SystemExit => e
  # Do nothing, just prevent a normal exit from causing an unsightly
  # error in the logs
end