Sha256: 8688d3a8019d0fa70ef92e9fe262b28a23b01e7da36ff009d552fa09bbd972e1

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'bunny'
require 'concurrent/executors'

require 'pika_que/configuration'
require 'pika_que/errors'
require 'pika_que/logging'
require 'pika_que/version'

require 'pika_que/connection'
require 'pika_que/publisher'
require 'pika_que/reporters/log_reporter'
require 'pika_que/middleware/chain'
require 'pika_que/handlers'
require 'pika_que/worker'

module PikaQue

  def self.config
    @config ||= Configuration.new
  end

  def self.configure(opts = {})
    config.merge!(opts)
  end

  def self.logger
    PikaQue::Logging.logger
  end

  def self.logger=(logger)
    PikaQue::Logging.logger = logger
  end

  def self.connection
    @connection ||= Connection.create
  end

  def self.middleware
    @chain ||= Middleware::Chain.new
    yield @chain if block_given?
    @chain
  end

  def self.reporters
    config[:reporters] << PikaQue::Reporters::LogReporter.new if config[:reporters].empty?
    config[:reporters]
  end

  def self.reset!
    @config = nil
    @connection = nil
    @chain = nil
  end

end

require 'pika_que/rails' if defined?(::Rails::Engine)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pika_que-0.1.6 lib/pika_que.rb