Sha256: 89b81011f8e3f35c8619799f78db4edd8f68c5f876ef37f07ee608d59ffd8467

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

# frozen_string_literal: true

require 'logger'
require 'forwardable'
require 'yaml'
require 'bunny'
require 'jackhammer/version'
require 'jackhammer/exceptions'
require 'jackhammer/log'
require 'jackhammer/configuration'
require 'jackhammer/message_receiver'
require 'jackhammer/queue'
require 'jackhammer/topic'
require 'jackhammer/topic_manager'
require 'jackhammer/server'

module Jackhammer
  class << self
    attr_accessor :configuration
    attr_writer :connection

    def configure
      @configuration = Configuration.instance
      yield @configuration
    end

    def connection
      @connection ||= Bunny.new(
        Jackhammer.configuration.connection_url,
        Jackhammer.configuration.connection_options
      ).start
    end

    def channel
      @channel ||= connection.create_channel
    end

    def topics
      @topics ||= TopicManager.topics
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackhammer-0.2.3 lib/jackhammer.rb