Class: Omnes::Publication
- Inherits:
-
Object
- Object
- Omnes::Publication
- Defined in:
- lib/omnes/publication.rb
Overview
The result of publishing an event
It encapsulates a published Event as well as the Executions it originated.
This class is useful mainly for debugging and logging purposes. An instance of it is returned on Bus#publish.
Instance Attribute Summary collapse
-
#context ⇒ Omnes::PublicationContext
readonly
Publication context, shared by all triggered executions.
-
#event ⇒ #name
readonly
Published event.
-
#executions ⇒ Array<Omnes::Execution>
readonly
Subscription executions that the publication originated.
Instance Method Summary collapse
-
#initialize(event:, executions:, context:) ⇒ Publication
constructor
private
A new instance of Publication.
Constructor Details
#initialize(event:, executions:, context:) ⇒ Publication
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Publication.
28 29 30 31 32 |
# File 'lib/omnes/publication.rb', line 28 def initialize(event:, executions:, context:) @event = event @executions = executions @context = context end |
Instance Attribute Details
#context ⇒ Omnes::PublicationContext (readonly)
Publication context, shared by all triggered executions
25 26 27 |
# File 'lib/omnes/publication.rb', line 25 def context @context end |
#event ⇒ #name (readonly)
Published event
15 16 17 |
# File 'lib/omnes/publication.rb', line 15 def event @event end |
#executions ⇒ Array<Omnes::Execution> (readonly)
Subscription executions that the publication originated
20 21 22 |
# File 'lib/omnes/publication.rb', line 20 def executions @executions end |