Sha256: da5f43d88e5c9fe83767356b19dce845e196f867ac25027260f8ddb3653e2c5d
Contents?: true
Size: 1.84 KB
Versions: 12
Compression:
Stored size: 1.84 KB
Contents
# -*- encoding: utf-8; mode: ruby -*- require "timeout" require "bunny/version" require "amq/protocol/client" require "amq/protocol/extensions" require "bunny/framing" require "bunny/exceptions" require "bunny/socket" require "bunny/timeout" begin require "openssl" require "bunny/ssl_socket" rescue LoadError # no-op end require "logger" # Core entities: connection, channel, exchange, queue, consumer require "bunny/session" require "bunny/channel" require "bunny/exchange" require "bunny/queue" require "bunny/consumer" # Bunny is a RabbitMQ client that focuses on ease of use. # @see http://rubybunny.info module Bunny # AMQP protocol version Bunny implements PROTOCOL_VERSION = AMQ::Protocol::PROTOCOL_VERSION # # API # # @return [String] Bunny version def self.version VERSION end # @return [String] AMQP protocol version Bunny implements def self.protocol_version AMQ::Protocol::PROTOCOL_VERSION end # Instantiates a new connection. The actual network # connection is started with {Bunny::Session#start} # # @return [Bunny::Session] # @see Bunny::Session#start # @see http://rubybunny.info/articles/getting_started.html # @see http://rubybunny.info/articles/connecting.html # @api public def self.new(connection_string_or_opts = {}, opts = {}, &block) if connection_string_or_opts.respond_to?(:keys) && opts.empty? opts = connection_string_or_opts end conn = Session.new(connection_string_or_opts, opts) @default_connection ||= conn conn end def self.run(connection_string_or_opts = {}, opts = {}, &block) raise ArgumentError, 'Bunny#run requires a block' unless block client = Session.new(connection_string_or_opts, opts) begin client.start block.call(client) ensure client.stop end # backwards compatibility :run_ok end end
Version data entries
12 entries across 12 versions & 1 rubygems