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.
Consider using the implementation of a process that uses message wiring.
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
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/synapse/process_manager/process.rb', line 26 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.
20 21 22 |
# File 'lib/synapse/process_manager/process.rb', line 20 def active @active end |
#correlations ⇒ CorrelationSet (readonly)
Returns The correlations for this process.
17 18 19 |
# File 'lib/synapse/process_manager/process.rb', line 17 def correlations @correlations end |
#id ⇒ String (readonly)
Returns The unique identifier of this process.
14 15 16 |
# File 'lib/synapse/process_manager/process.rb', line 14 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.
46 |
# File 'lib/synapse/process_manager/process.rb', line 46 def handle(event); end |