Sha256: 42442b35dd37a18bc33341c2be9bd5e8a83f6bf2d657969cfb83f2a168bb8172

Contents?: true

Size: 975 Bytes

Versions: 1

Compression:

Stored size: 975 Bytes

Contents

require 'legion/transport/version'
require 'legion/settings'
require 'legion/transport/settings'

module Legion
  module Transport
    begin
      require 'march_hare'
      TYPE = 'march_hare'.freeze
      CONNECTOR = ::MarchHare
    rescue LoadError
      require 'bunny'
      TYPE = 'bunny'.freeze
      CONNECTOR = ::Bunny
    end

    class << self
      def logger
        @logger unless @logger.nil?

        if ::Legion.const_defined?('Logging')
          @logger = ::Legion::Logging
        else
          require 'logger'
          @logger = ::Logger.new($stdout)
          @logger.level = Logger::ERROR
        end

        @logger
      end

      def settings
        Legion::Settings[:transport] if Legion.const_defined? 'Settings'

        Legion::Transport::Settings.default
      end
    end
  end

  require_relative 'transport/common'
  require_relative 'transport/queue'
  require_relative 'transport/exchange'
  require_relative 'transport/message'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legion-transport-1.2.0 lib/legion/transport.rb