Class: Synapse::ProcessManager::Process Abstract
- Inherits:
-
Object
- Object
- Synapse::ProcessManager::Process
- Defined in:
- lib/synapse/process_manager/process.rb
Overview
Processes are used to maintain the state of long-running business transactions
The term process is used in Enterprise Integration Patterns to describe a mechanism used to “maintain the state of the sequence and determine the next processing step based on intermediate results” (Hohpe 279). Processes are also called sagas in some CQRS frameworks.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#active ⇒ Boolean
(also: #active?)
readonly
True if this process is active.
-
#correlations ⇒ CorrelationSet
readonly
The correlations for this process.
-
#id ⇒ String
readonly
The unique identifier of this process.
Instance Method Summary collapse
-
#handle(event) ⇒ undefined
abstract
Handles the given event.
- #initialize(id = nil) ⇒ undefined constructor
Constructor Details
#initialize(id = nil) ⇒ undefined
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/synapse/process_manager/process.rb', line 24 def initialize(id = nil) unless id id = IdentifierFactory.instance.generate end @id = id @correlations = CorrelationSet.new @active = true correlate_with :process_id, id end |
Instance Attribute Details
#active ⇒ Boolean (readonly) Also known as: active?
Returns True if this process is active.
18 19 20 |
# File 'lib/synapse/process_manager/process.rb', line 18 def active @active end |
#correlations ⇒ CorrelationSet (readonly)
Returns The correlations for this process.
15 16 17 |
# File 'lib/synapse/process_manager/process.rb', line 15 def correlations @correlations end |
#id ⇒ String (readonly)
Returns The unique identifier of this process.
12 13 14 |
# File 'lib/synapse/process_manager/process.rb', line 12 def id @id end |
Instance Method Details
#handle(event) ⇒ undefined
Handles the given event
The actual result of the processing depends on the implementation of the process. Implementations are highly discouraged from throwing exceptions.
44 |
# File 'lib/synapse/process_manager/process.rb', line 44 def handle(event); end |