Class: LocalBus::Publication
- Inherits:
-
Object
- Object
- LocalBus::Publication
- Defined in:
- lib/local_bus/publication.rb
Overview
Wraps an Async::Barrier and a list of Subscribers that are processing a Message.
Instance Method Summary collapse
-
#initialize(barrier, *subscribers) ⇒ Publication
constructor
Constructor.
-
#subscribers ⇒ Object
List of Subscribers that are processing a Message.
-
#wait ⇒ Object
Blocks and waits for the barrier (i.e. all subscribers to complete).
Constructor Details
#initialize(barrier, *subscribers) ⇒ Publication
Constructor
9 10 11 12 |
# File 'lib/local_bus/publication.rb', line 9 def initialize(, *subscribers) @barrier = @subscribers = subscribers end |
Instance Method Details
#subscribers ⇒ Object
Note:
Blocks until all subscribers complete
List of Subscribers that are processing a Message
24 25 26 27 |
# File 'lib/local_bus/publication.rb', line 24 def subscribers wait @subscribers end |
#wait ⇒ Object
Blocks and waits for the barrier (i.e. all subscribers to complete)
16 17 18 19 |
# File 'lib/local_bus/publication.rb', line 16 def wait @barrier.wait self end |