Sha256: 03c3c997e6b791724d63d991cf2767cc658e593f9a196c9b3f7900b2efbdb0c9

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

require 'firehose/version'

require 'amqp'
require 'logger'

module Firehose
  autoload :Default,      'firehose/default'
  autoload :Subscription, 'firehose/subscription'
  autoload :Producer,     'firehose/producer'
  autoload :Publisher,    'firehose/publisher'
  autoload :Rack,         'firehose/rack'
  autoload :CLI,          'firehose/cli'

  # TODO move this into a configuration or session class.
  # Hang on to AMQP configuration settings.
  def self.amqp
    @amqp ||= Struct.new(:connection).new(AMQP.connect)
  end

  # TODO figure out a better way to memoize AMQP connection for production runtimes, and 
  # make it resetable for testing environment. Some sort of Firehose::Session object is probably
  # in order
  def self.reset!
    @amqp = nil
  end

  # Logging
  def self.logger
    @logger ||= Logger.new($stdout)
  end

  def self.logger=(logger)
    @logger = logger
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
firehose-0.0.15 lib/firehose.rb
firehose-0.0.14 lib/firehose.rb
firehose-0.0.13 lib/firehose.rb