Module: Batsir::AMQP
- Included in:
- Batsir::Acceptors::AMQPAcceptor, Notifiers::AMQPNotifier
- Defined in:
- lib/batsir/amqp.rb
Instance Attribute Summary collapse
-
#durable ⇒ Object
Returns the value of attribute durable.
-
#exchange ⇒ Object
Returns the value of attribute exchange.
-
#heartbeat ⇒ Object
Returns the value of attribute heartbeat.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#username ⇒ Object
Returns the value of attribute username.
-
#vhost ⇒ Object
Returns the value of attribute vhost.
Instance Method Summary collapse
Instance Attribute Details
#durable ⇒ Object
Returns the value of attribute durable.
8 9 10 |
# File 'lib/batsir/amqp.rb', line 8 def durable @durable end |
#exchange ⇒ Object
Returns the value of attribute exchange.
10 11 12 |
# File 'lib/batsir/amqp.rb', line 10 def exchange @exchange end |
#heartbeat ⇒ Object
Returns the value of attribute heartbeat.
11 12 13 |
# File 'lib/batsir/amqp.rb', line 11 def heartbeat @heartbeat end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/batsir/amqp.rb', line 4 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/batsir/amqp.rb', line 7 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/batsir/amqp.rb', line 5 def port @port end |
#queue ⇒ Object
Returns the value of attribute queue.
3 4 5 |
# File 'lib/batsir/amqp.rb', line 3 def queue @queue end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/batsir/amqp.rb', line 6 def username @username end |
#vhost ⇒ Object
Returns the value of attribute vhost.
9 10 11 |
# File 'lib/batsir/amqp.rb', line 9 def vhost @vhost end |
Instance Method Details
#bunny_options ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/batsir/amqp.rb', line 13 def { :host => host, :port => port, :user => username, :pass => password, :vhost => vhost, :heartbeat => heartbeat } end |
#bunny_pool ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/batsir/amqp.rb', line 64 def bunny_pool @bunny_pool = Batsir::Registry.get(bunny_pool_key) if !@bunny_pool pool = ConnectionPool.new(:size => bunny_pool_size) { Bunny.new().start } @bunny_pool = Batsir::Registry.register(bunny_pool_key, pool) end @bunny_pool end |
#bunny_pool_key ⇒ Object
60 61 62 |
# File 'lib/batsir/amqp.rb', line 60 def bunny_pool_key "bunny_pool_for_#{host}_#{port}_#{vhost}" end |