Class: Superbolt::Adapter::Bunny
- Inherits:
-
Base
- Object
- Base
- Superbolt::Adapter::Bunny
show all
- Defined in:
- lib/superbolt/adapter/bunny.rb
Instance Attribute Summary
Attributes inherited from Base
#config
Instance Method Summary
collapse
Methods inherited from Base
#exchange, #initialize
Instance Method Details
#channel ⇒ Object
14
15
16
|
# File 'lib/superbolt/adapter/bunny.rb', line 14
def channel
@channel ||= socket.create_channel
end
|
#close ⇒ Object
18
19
20
21
22
|
# File 'lib/superbolt/adapter/bunny.rb', line 18
def close
response = channel.close
@channel = nil
response
end
|
#establish_socket ⇒ Object
8
9
10
11
12
|
# File 'lib/superbolt/adapter/bunny.rb', line 8
def establish_socket
socket = ::Bunny.new(config.connection_params)
socket.start
socket
end
|
#socket ⇒ Object
4
5
6
|
# File 'lib/superbolt/adapter/bunny.rb', line 4
def socket
Thread.current[:bunny_socket] ||= establish_socket
end
|