Class GatedKeyValueStore
In-memory IKeyValueStore whose FIRST GetAsync call captures the current value and then
suspends until the test calls ReleaseFirstReadGate() — returning the value it
captured BEFORE suspending. This lets a test hold one read-modify-write cycle open on its
stale snapshot while issuing a second concurrent operation, proving (or disproving)
lost-update protection in the store under test.
Inheritance
GatedKeyValueStore
Assembly: Tests.dll
Syntax
public class GatedKeyValueStore : IKeyValueStore, IKeyedStore, IPersistenceStore
Constructors
GatedKeyValueStore()
Declaration
public GatedKeyValueStore()
Properties
Namespace
Declaration
public string Namespace { get; }
Property Value
Methods
DeleteAsync(string, CancellationToken)
Declaration
public Task DeleteAsync(string key, CancellationToken cancellationToken)
Parameters
Returns
ExistsAsync(string, CancellationToken)
Declaration
public Task<bool> ExistsAsync(string key, CancellationToken cancellationToken)
Parameters
Returns
GetAsync(string, CancellationToken)
Declaration
public Task<ReadOnlyMemory<byte>?> GetAsync(string key, CancellationToken cancellationToken)
Parameters
Returns
| Type |
Description |
| Task<ReadOnlyMemory<byte>?> |
|
HealthCheckAsync(CancellationToken)
Declaration
public Task<bool> HealthCheckAsync(CancellationToken cancellationToken)
Parameters
Returns
ReleaseFirstReadGate()
Releases the suspended first read, letting its operation continue with the pre-captured value.
Declaration
public void ReleaseFirstReadGate()
SetAsync(string, ReadOnlyMemory<byte>, CancellationToken)
Declaration
public Task SetAsync(string key, ReadOnlyMemory<byte> value, CancellationToken cancellationToken)
Parameters
Returns
Implements