Provides instances of named locks for synchronizing concurrent executions of cached methods.
Namespace: Metalama.Patterns.Caching.Locking
Assembly: Metalama.Patterns.Caching.Backend.dll
Syntax
public interface ILockingStrategyRemarks
Two built-in implementations are provided:
- NullLockingStrategy: Allows concurrent execution (default).
- LocalLockingStrategy: Prevents concurrent execution of the same method with the same parameters in the current process.
The locking strategy is configured per caching profile through the
CachingProfile.LockingStrategy property.
Methods
| Name | Description |
|---|---|
| GetLock(string) | Gets a handle to a named lock. This method must return immediately. Waiting, if any, must be done in the Acquire(TimeSpan, CancellationToken) method. |