class Synapse::ProcessManager::ProcessRepository

Represents a mechanism for storing and loading process instances @abstract

Public Instance Methods

add(process) click to toggle source

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.

@abstract @param [Process] process @return [undefined]

# File lib/synapse/process_manager/process_repository.rb, line 56
def add(process)
  raise NotImplementedError
end
commit(process) click to toggle source

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.

@abstract @param [Process] process @return [undefined]

# File lib/synapse/process_manager/process_repository.rb, line 42
def commit(process)
  raise NotImplementedError
end
find(type, correlation) click to toggle source

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

@abstract @param [Class] type @param [Correlation] correlation @return [Set<String>]

# File lib/synapse/process_manager/process_repository.rb, line 15
def find(type, correlation)
  raise NotImplementedError
end
load(id) click to toggle source

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.

@abstract @param [String] id @return [Process] Returns nil if process could not be found

# File lib/synapse/process_manager/process_repository.rb, line 30
def load(id)
  raise NotImplementedError
end