Module: Bifrost

Defined in:
lib/bifrost.rb,
lib/bifrost/bus.rb,
lib/bifrost/topic.rb,
lib/bifrost/entity.rb,
lib/bifrost/worker.rb,
lib/bifrost/manager.rb,
lib/bifrost/message.rb,
lib/bifrost/version.rb,
lib/bifrost/subscriber.rb,
lib/bifrost/exceptions/message_delivery_error.rb,
lib/bifrost/exceptions/unsupported_lambda_error.rb,
lib/bifrost/exceptions/duplicate_subscriber_error.rb,
lib/bifrost/exceptions/invalid_worker_definition_error.rb

Overview

Major.Minor.Patch version numbering

Defined Under Namespace

Modules: Exceptions Classes: Bus, Entity, Manager, Message, Subscriber, Topic, Worker

Constant Summary collapse

MAJOR_VERSION =

The major version of Bifrost, updated only for major changes that are likely to require modification to Filmpond apps.

1
MINOR_VERSION =

The minor version of Bifrost, updated for new feature releases.

1
PATCH_VERSION =

The patch version of Bifrost, updated only for bug fixes from the last feature release.

1
VERSION =

The full version as a string.

"#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}".freeze

Class Method Summary collapse

Class Method Details

.busObject

Get an instance of the bus



42
43
44
# File 'lib/bifrost.rb', line 42

def self.bus
  Bifrost::Bus.new
end

.create_topic_with_subscriber(topic, subscriber) ⇒ Object

Simple utlity that creates a topic and a single subscriber for the given topic. The topic is returned



34
35
36
37
38
39
# File 'lib/bifrost.rb', line 34

def self.create_topic_with_subscriber(topic, subscriber)
  topic = Bifrost::Topic.new(topic)
  topic.save
  topic.add_subscriber(Bifrost::Subscriber.new(subscriber))
  topic
end

.debug?Boolean

Helper method for other types in the Bifrost to know when logging is turned on

Returns:

  • (Boolean)


28
29
30
# File 'lib/bifrost.rb', line 28

def self.debug?
  ENV['BIFROST_DEBUG']
end

.logger=(log_provider) ⇒ Object

Workers and the infrastructure can log using the standard level of granularity affored to any standard logger (i.e. info, debug, error levels etc)



22
23
24
# File 'lib/bifrost.rb', line 22

def self.logger=(log_provider)
  Celluloid.logger = log_provider
end

.managerObject

Creates a manager instance



47
48
49
# File 'lib/bifrost.rb', line 47

def self.manager
  Bifrost::Manager.new
end