Class: BPS::Publisher::InMem
- Defined in:
- lib/bps/publisher/in_mem.rb
Defined Under Namespace
Classes: Topic
Instance Method Summary collapse
-
#initialize ⇒ InMem
constructor
A new instance of InMem.
-
#topic(name) ⇒ Object
Retrieve a topic handle.
-
#topic_names ⇒ Array<String>
The existing topic names.
Methods inherited from Abstract
Constructor Details
#initialize ⇒ InMem
Returns a new instance of InMem.
19 20 21 22 |
# File 'lib/bps/publisher/in_mem.rb', line 19 def initialize super() @topics = {} end |
Instance Method Details
#topic(name) ⇒ Object
Retrieve a topic handle.
31 32 33 34 35 36 37 38 |
# File 'lib/bps/publisher/in_mem.rb', line 31 def topic(name) name = name.to_s @topics[name] ||= begin @topic_names = nil self.class::Topic.new(name) end end |
#topic_names ⇒ Array<String>
Returns the existing topic names.
25 26 27 |
# File 'lib/bps/publisher/in_mem.rb', line 25 def topic_names @topic_names ||= @topics.keys.sort end |