Class: SagaForge::Execution::CompensationFacade
- Inherits:
-
Object
- Object
- SagaForge::Execution::CompensationFacade
- Defined in:
- lib/saga_forge/execution/compensation_facade.rb
Overview
Yielded to compensation blocks: context is the snapshot (§A.4). No transition verbs — rollback has one direction.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#correlation_id ⇒ Object
readonly
Returns the value of attribute correlation_id.
-
#current_state ⇒ Object
readonly
Returns the value of attribute current_state.
-
#staged_publishes ⇒ Object
readonly
Returns the value of attribute staged_publishes.
Instance Method Summary collapse
-
#initialize(correlation_id:, current_state:, context:) ⇒ CompensationFacade
constructor
A new instance of CompensationFacade.
- #publish(event_name, **payload) ⇒ Object
Constructor Details
#initialize(correlation_id:, current_state:, context:) ⇒ CompensationFacade
Returns a new instance of CompensationFacade.
8 9 10 11 12 13 |
# File 'lib/saga_forge/execution/compensation_facade.rb', line 8 def initialize(correlation_id:, current_state:, context:) @correlation_id = correlation_id @current_state = current_state @context = context @staged_publishes = [] end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/saga_forge/execution/compensation_facade.rb', line 6 def context @context end |
#correlation_id ⇒ Object (readonly)
Returns the value of attribute correlation_id.
6 7 8 |
# File 'lib/saga_forge/execution/compensation_facade.rb', line 6 def correlation_id @correlation_id end |
#current_state ⇒ Object (readonly)
Returns the value of attribute current_state.
6 7 8 |
# File 'lib/saga_forge/execution/compensation_facade.rb', line 6 def current_state @current_state end |
#staged_publishes ⇒ Object (readonly)
Returns the value of attribute staged_publishes.
6 7 8 |
# File 'lib/saga_forge/execution/compensation_facade.rb', line 6 def staged_publishes @staged_publishes end |