Module: Bunny
- Defined in:
- lib/bunny.rb,
lib/bunny/queue.rb,
lib/bunny/socket.rb,
lib/bunny/socket.rb,
lib/bunny/channel.rb,
lib/bunny/framing.rb,
lib/bunny/session.rb,
lib/bunny/timeout.rb,
lib/bunny/version.rb,
lib/bunny/consumer.rb,
lib/bunny/exchange.rb,
lib/bunny/test_kit.rb,
lib/bunny/timestamp.rb,
lib/bunny/transport.rb,
lib/bunny/exceptions.rb,
lib/bunny/ssl_socket.rb,
lib/bunny/ssl_socket.rb,
lib/bunny/reader_loop.rb,
lib/bunny/return_info.rb,
lib/bunny/cruby/socket.rb,
lib/bunny/get_response.rb,
lib/bunny/jruby/socket.rb,
lib/bunny/delivery_info.rb,
lib/bunny/cruby/ssl_socket.rb,
lib/bunny/heartbeat_sender.rb,
lib/bunny/jruby/ssl_socket.rb,
lib/bunny/consumer_work_pool.rb,
lib/bunny/message_properties.rb,
lib/bunny/channel_id_allocator.rb,
lib/bunny/concurrent/condition.rb,
lib/bunny/consumer_tag_generator.rb,
lib/bunny/versioned_delivery_tag.rb,
lib/bunny/concurrent/atomic_fixnum.rb,
lib/bunny/concurrent/continuation_queue.rb,
lib/bunny/authentication/credentials_encoder.rb,
lib/bunny/concurrent/synchronized_sorted_set.rb,
lib/bunny/concurrent/linked_continuation_queue.rb,
lib/bunny/authentication/plain_mechanism_encoder.rb,
lib/bunny/authentication/external_mechanism_encoder.rb
Overview
Bunny is a RabbitMQ client that focuses on ease of use.
Defined Under Namespace
Modules: Authentication, Concurrent, Framing, JRuby, Socket Classes: AccessRefused, AuthenticationFailureError, BadLengthError, Channel, ChannelAlreadyClosed, ChannelError, ChannelIdAllocator, ChannelLevelException, ClientTimeout, CommandInvalid, ConnectionAlreadyClosed, ConnectionClosedError, ConnectionForced, ConnectionLevelException, ConnectionTimeout, Consumer, ConsumerTagGenerator, ConsumerWorkPool, DeliveryInfo, Exception, Exchange, ForcedChannelCloseError, ForcedConnectionCloseError, FrameError, GetResponse, HeartbeatSender, HostListDepleted, InconsistentDataError, InternalError, MessageError, MessageProperties, MissingTLSCertificateFile, MissingTLSKeyFile, NetworkErrorWrapper, NetworkFailure, NoFinalOctetError, NotAllowedError, NotFound, PossibleAuthenticationFailureError, PreconditionFailed, ProtocolError, Queue, ReaderLoop, ResourceError, ResourceLocked, ReturnInfo, Session, ShutdownSignal, TCPConnectionFailed, TCPConnectionFailedForAllHosts, TestKit, Timestamp, Transport, UnexpectedFrame, VersionedDeliveryTag
Constant Summary collapse
- PROTOCOL_VERSION =
AMQP protocol version Bunny implements
AMQ::Protocol::PROTOCOL_VERSION
- SocketImpl =
Socket
- Client =
backwards compatibility
Session
- Timeout =
::Timeout
- Timer =
Backwards compatibility
Timeout
- VERSION =
Returns Version of the library.
"2.23.0"
- ConnectionError =
backwards compatibility
TCPConnectionFailed
- ServerDownError =
TCPConnectionFailed
- SSLSocketImpl =
SSLSocket
Class Method Summary collapse
-
.new(connection_string_or_opts = ENV['RABBITMQ_URL'], optz = {}) ⇒ Bunny::Session
Instantiates a new connection.
-
.protocol_version ⇒ String
AMQP protocol version Bunny implements.
- .run(connection_string_or_opts = ENV['RABBITMQ_URL'], opts = {}, &block) ⇒ Object
-
.version ⇒ String
Bunny version.
Class Method Details
.new(connection_string_or_opts = ENV['RABBITMQ_URL'], optz = {}) ⇒ Bunny::Session
Instantiates a new connection. The actual network connection is started with Bunny::Session#start
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/bunny.rb', line 102 def self.new(connection_string_or_opts = ENV['RABBITMQ_URL'], optz = {}) if connection_string_or_opts.respond_to?(:keys) && optz.empty? optz = connection_string_or_opts end conn = Session.new(connection_string_or_opts, optz) @default_connection ||= conn conn end |
.protocol_version ⇒ String
Returns AMQP protocol version Bunny implements.
49 50 51 |
# File 'lib/bunny.rb', line 49 def self.protocol_version AMQ::Protocol::PROTOCOL_VERSION end |
.run(connection_string_or_opts = ENV['RABBITMQ_URL'], opts = {}, &block) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/bunny.rb', line 114 def self.run(connection_string_or_opts = ENV['RABBITMQ_URL'], opts = {}, &block) raise ArgumentError, 'Bunny#run requires a block' unless block if connection_string_or_opts.respond_to?(:keys) && opts.empty? opts = connection_string_or_opts end client = Session.new(connection_string_or_opts, opts) begin client.start block.call(client) ensure client.stop end # backwards compatibility :run_ok end |
.version ⇒ String
Returns Bunny version.
44 45 46 |
# File 'lib/bunny.rb', line 44 def self.version VERSION end |