Class: Omnes::Publication

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#contextOmnes::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

Returns:

  • (#name)


15
16
17
# File 'lib/omnes/publication.rb', line 15

def event
  @event
end

#executionsArray<Omnes::Execution> (readonly)

Subscription executions that the publication originated

Returns:



20
21
22
# File 'lib/omnes/publication.rb', line 20

def executions
  @executions
end