Class: OmfCommon::Comm::Local::Topic

Inherits:
Topic
  • Object
show all
Defined in:
lib/omf_common/comm/local/local_topic.rb

Constant Summary collapse

@@marshall_messages =
true

Instance Attribute Summary

Attributes inherited from Topic

#id

Class Method Summary collapse

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, #unsubscribe

Class Method Details

.marshall_messages=(flag) ⇒ Object

If set to ‘true’ marshall and immediately unmarshall before handing it on messages



16
17
18
# File 'lib/omf_common/comm/local/local_topic.rb', line 16

def self.marshall_messages=(flag)
  @@marshall_messages = (flag == true)
end

Instance Method Details

#addressObject



28
29
30
# File 'lib/omf_common/comm/local/local_topic.rb', line 28

def address
  @id
end

#on_subscribed(&block) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/omf_common/comm/local/local_topic.rb', line 32

def on_subscribed(&block)
  return unless block

  OmfCommon.eventloop.after(0) do
    block.arity == 1 ? block.call(self) : block.call
  end
end

#to_sObject

end



24
25
26
# File 'lib/omf_common/comm/local/local_topic.rb', line 24

def to_s
  "Local::Topic<#{id}>"
end