Skip to content

IJournaledStateManager Methods

Manages the states for a given grain.

DeleteStateAsync(CancellationToken)

abstract
public abstract ValueTask DeleteStateAsync(CancellationToken cancellationToken)
Resets this instance, removing any persistent state.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

A System.Threading.Tasks.ValueTask which represents the operation.

InitializeAsync(CancellationToken)

abstract
public abstract ValueTask InitializeAsync(CancellationToken cancellationToken)
Initializes the state manager.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

A System.Threading.Tasks.ValueTask which represents the operation.

RegisterState(string, IJournaledState)

abstract
public abstract void RegisterState(string name, IJournaledState state)
Registers a state with the manager.

Parameters

namestring
The state's stable identifier.
stateIJournaledState
The state instance to register.

TryGetState(string, IJournaledState?)

abstract
public abstract bool TryGetState(string name, out IJournaledState? state)
Attempts to get a state registered with the manager.

Parameters

namestring
The state's stable identifier.
stateIJournaledState?
The state instance, if one is registered for name.

WriteStateAsync(CancellationToken)

abstract
public abstract ValueTask WriteStateAsync(CancellationToken cancellationToken)
Prepares and persists an update to the journal.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

A System.Threading.Tasks.ValueTask which represents the operation.