Sha256: baf374032f52c56b5e45f0eee7c40c934e2c1979ae501fa79d0243606f0115de

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

require 'bunny'
require 'singleton'

module Rack
  module AMQP
    module Client

      def self.with_client(*args, &block)
        yield client(*args)
      end

      def self.client(*args)
        Synchronizer.instance.client(*args)
      end

      class Synchronizer
        include Singleton
        def initialize
          @mutex = Mutex.new
          super
        end

        def client(*args)
          @mutex.synchronize do # TODO this probably doesn't help anything here
            @mgr ||= Manager.new(*args)
          end
        end
      end

    end
  end
end

require "rack/amqp/client/request"
require "rack/amqp/client/response"
require "rack/amqp/client/null_response"
require "rack/amqp/client/manager"
require "rack/amqp/client/version"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-amqp-client-0.0.3 lib/rack/amqp/client.rb