Class: Synapse::Repository::LockManager Abstract
- Inherits:
-
Object
- Object
- Synapse::Repository::LockManager
- Defined in:
- lib/synapse/repository/lock_manager.rb
Overview
Represents a mechanism for locking aggregates for modification
Direct Known Subclasses
NullLockManager, OptimisticLockManager, PessimisticLockManager
Instance Method Summary collapse
-
#obtain_lock(aggregate_id) ⇒ undefined
abstract
Obtains a lock for an aggregate with the given aggregate identifier.
-
#release_lock(aggregate_id) ⇒ undefined
abstract
Releases the lock held for an aggregate with the given aggregate identifier.
-
#validate_lock(aggregate) ⇒ Boolean
abstract
Ensures that the current thread holds a valid lock for the given aggregate.
Instance Method Details
#obtain_lock(aggregate_id) ⇒ undefined
Obtains a lock for an aggregate with the given aggregate identifier. Depending on the strategy, this method may return immediately or block until a lock is held.
19 |
# File 'lib/synapse/repository/lock_manager.rb', line 19 def obtain_lock(aggregate_id); end |
#release_lock(aggregate_id) ⇒ undefined
Releases the lock held for an aggregate with the given aggregate identifier. The caller of this method must ensure a valid lock was requested using #obtain_lock. If no lock was successfully obtained, the behavior of this method is undefined.
28 |
# File 'lib/synapse/repository/lock_manager.rb', line 28 def release_lock(aggregate_id); end |
#validate_lock(aggregate) ⇒ Boolean
Ensures that the current thread holds a valid lock for the given aggregate
11 |
# File 'lib/synapse/repository/lock_manager.rb', line 11 def validate_lock(aggregate); end |