Class: OmfCommon::Comm::AMQP::Topic
- Inherits:
-
Topic
- Object
- Topic
- OmfCommon::Comm::AMQP::Topic
show all
- Defined in:
- lib/omf_common/comm/amqp/amqp_topic.rb
Instance Attribute Summary
Attributes inherited from Topic
#id, #routing_key
Instance Method Summary
collapse
Methods inherited from Topic
[], #after, #configure, create, #create, #create_message_and_publish, #error?, #inform, #on_inform, #on_message, #publish, #release, #request
Instance Method Details
#address ⇒ Object
17
18
19
|
# File 'lib/omf_common/comm/amqp/amqp_topic.rb', line 17
def address
@address
end
|
#on_subscribed(&block) ⇒ Object
Call ‘block’ when topic is subscribed to underlying messaging infrastructure.
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/omf_common/comm/amqp/amqp_topic.rb', line 24
def on_subscribed(&block)
return unless block
call_now = false
@lock.synchronize do
if @subscribed
call_now = true
else
@on_subscribed_handlers << block
end
end
if call_now
after(0, &block)
end
end
|
#to_s ⇒ Object
13
14
15
|
# File 'lib/omf_common/comm/amqp/amqp_topic.rb', line 13
def to_s
@address
end
|
#unsubscribe(key) ⇒ Object
40
41
42
43
|
# File 'lib/omf_common/comm/amqp/amqp_topic.rb', line 40
def unsubscribe(key)
super
@exchange.delete
end
|