Skip to content

ICustomStorageInterface<TState, TDelta> Methods

The storage interface exposed by grains that want to use the CustomStorage log-consistency provider

ApplyUpdatesToStorage(IReadOnlyList<TDelta>, int)

abstract
public abstract Task<bool> ICustomStorageInterface<TState, ApplyUpdatesToStorage(IReadOnlyList<TDelta> updates, int expectedVersion)
Applies the given array of deltas to storage, and returns true, if the version in storage matches the expected version. Otherwise, does nothing and returns false. If successful, the version of storage must be increased by the number of deltas.

Parameters

updatesIReadOnlyList<TDelta>
expectedVersionint

Returns

true if the deltas were applied, false otherwise

ClearStoredState

virtual
View source
public virtual Task ICustomStorageInterface<TState, ClearStoredState()
Clears the stored state in storage.

Returns

A task that represents the asynchronous clear operation.

ReadStateFromStorage

abstract
public abstract Task<KeyValuePair<int, TState>> ICustomStorageInterface<TState, ReadStateFromStorage()
Reads the current state and version from storage (note that the state object may be mutated by the provider, so it must not be shared).

Returns

the version number and a state object.