Class: Hutch::Adapters::BunnyAdapter
- Inherits:
-
Object
- Object
- Hutch::Adapters::BunnyAdapter
- Extended by:
- Forwardable
- Defined in:
- lib/hutch/adapters/bunny.rb
Constant Summary collapse
- DEFAULT_VHOST =
Bunny::Session::DEFAULT_VHOST
- ConnectionRefused =
Bunny::TCPConnectionFailed
- PreconditionFailed =
Bunny::PreconditionFailed
Class Method Summary collapse
- .decode_message(delivery_info, properties, payload) ⇒ Object
- .new_exchange(ch, exchange_type, exchange_name, exchange_options) ⇒ Object
Instance Method Summary collapse
- #current_timestamp ⇒ Object
-
#initialize(opts = {}) ⇒ BunnyAdapter
constructor
A new instance of BunnyAdapter.
- #prefetch_channel(ch, prefetch) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ BunnyAdapter
Returns a new instance of BunnyAdapter.
16 17 18 |
# File 'lib/hutch/adapters/bunny.rb', line 16 def initialize(opts={}) @connection = Bunny.new(opts) end |
Class Method Details
.decode_message(delivery_info, properties, payload) ⇒ Object
20 21 22 |
# File 'lib/hutch/adapters/bunny.rb', line 20 def self.(delivery_info, properties, payload) [delivery_info, properties, payload] end |
.new_exchange(ch, exchange_type, exchange_name, exchange_options) ⇒ Object
32 33 34 |
# File 'lib/hutch/adapters/bunny.rb', line 32 def self.new_exchange(ch, exchange_type, exchange_name, ) Bunny::Exchange.new(ch, exchange_type, exchange_name, ) end |
Instance Method Details
#current_timestamp ⇒ Object
28 29 30 |
# File 'lib/hutch/adapters/bunny.rb', line 28 def Time.now.to_i end |
#prefetch_channel(ch, prefetch) ⇒ Object
24 25 26 |
# File 'lib/hutch/adapters/bunny.rb', line 24 def prefetch_channel(ch, prefetch) ch.prefetch(prefetch) if prefetch end |