Skip to content

IStreamCheckpointStore Methods

Stores a persistent stream checkpoint using conditional updates.

Load(CancellationToken)

abstract
public abstract ValueTask<StreamCheckpointStoreState> Load(CancellationToken cancellationToken)
Loads the current checkpoint and its version.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

The current checkpoint state.

Update(string, string, CancellationToken)

abstract
public abstract ValueTask<StreamCheckpointStoreState> Update(string checkpoint, string expectedVersion, CancellationToken cancellationToken)
Updates the checkpoint if expectedVersion matches the persisted version.

Parameters

checkpointstring
The checkpoint to persist.
expectedVersionstring
The expected persisted version.
cancellationTokenCancellationToken
The cancellation token.

Returns

The persisted state after the update attempt. If the expected version did not match, the returned state contains the conflicting persisted checkpoint and version.