Edit

Share via


IPersistentState<TState> Interface

Definition

Provides access to grain state with functionality to save, clear, and refresh the state.

public interface IPersistentState<TState> : Orleans.Core.IStorage<TState>
public interface IPersistentState<TState> : Orleans.Core.IStorage<TState> where TState : new()
type IPersistentState<'State> = interface
    interface IStorage<'State>
    interface IStorage
type IPersistentState<'State (requires 'State : (new : unit -> 'State))> = interface
    interface IStorage<'State (requires 'State : (new : unit -> 'State))>
Public Interface IPersistentState(Of TState)
Implements IStorage(Of TState)

Type Parameters

TState

The underlying state type.

Implements

Properties

Name Description
Etag (Inherited from IStorage<TState>)
RecordExists

Gets a value indicating whether the record already exists.

(Inherited from IStorage)
State

Gets or sets the state.

(Inherited from IStorage<TState>)

Methods

Name Description
ClearStateAsync()

Async method to cause the current grain state data to be cleared and reset. This will usually mean the state record is deleted from backing store, but the specific behavior is defined by the storage provider instance configured for this grain. If Etags do not match, then this operation will fail; Set Etag = null to indicate "always delete".

(Inherited from IStorage<TState>)
ClearStateAsync(CancellationToken)

Clears the grain state.

(Inherited from IStorage)
ReadStateAsync()

Async method to cause refresh of the current grain state data from backing store. Any previous contents of the grain state data will be overwritten.

(Inherited from IStorage<TState>)
ReadStateAsync(CancellationToken)

Reads grain state from storage.

(Inherited from IStorage)
WriteStateAsync()

Async method to cause write of the current grain state data into backing store. If Etags do not match, then this operation will fail; Set Etag = null to indicate "always overwrite".

(Inherited from IStorage<TState>)
WriteStateAsync(CancellationToken)

Writes grain state to storage.

(Inherited from IStorage)

Applies to

See also