Class: Synapse::ProcessManager::ProcessRepository Abstract
- Inherits:
-
Object
- Object
- Synapse::ProcessManager::ProcessRepository
- Defined in:
- lib/synapse/process_manager/process_repository.rb
Overview
Represents a mechanism for storing and loading process instances
Direct Known Subclasses
Instance Method Summary collapse
-
#add(process) ⇒ undefined
abstract
Registers a newly created process with the repository.
-
#commit(process) ⇒ undefined
abstract
Commits the changes made to the process instance.
-
#find(type, correlation) ⇒ Set
abstract
Returns a set of process identifiers for processes of the given type that have been correlated with the given key value pair.
-
#load(id) ⇒ Process
abstract
Loads a known process by its unique identifier.
Instance Method Details
#add(process) ⇒ undefined
Registers a newly created process with the repository
Once a process has been registered, it can be found using its correlations or by its unique identifier.
Note that if the added process is marked as inactive, it will not be stored.
56 57 58 |
# File 'lib/synapse/process_manager/process_repository.rb', line 56 def add(process) raise NotImplementedError end |
#commit(process) ⇒ undefined
Commits the changes made to the process instance
If the committed process is marked as inactive, it should delete the process from the underlying storage and remove all correlations for that process.
42 43 44 |
# File 'lib/synapse/process_manager/process_repository.rb', line 42 def commit(process) raise NotImplementedError end |
#find(type, correlation) ⇒ Set
Returns a set of process identifiers for processes of the given type that have been correlated with the given key value pair
Processes that have been changed must be committed for changes to take effect
15 16 17 |
# File 'lib/synapse/process_manager/process_repository.rb', line 15 def find(type, correlation) raise NotImplementedError end |
#load(id) ⇒ Process
Loads a known process by its unique identifier
Processes that have been changed must be committed for changes to take effect
Due to the concurrent nature of processes, it is not unlikely for a process to have ceased to exist after it has been found based on correlations. Therefore, a repository should gracefully handle a missing process.
30 31 32 |
# File 'lib/synapse/process_manager/process_repository.rb', line 30 def load(id) raise NotImplementedError end |