Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IPersistentState<TState> Interface

Definition

Namespace:
Orleans.Runtime
Assembly:
Orleans.Runtime.dll
Assembly:
Orleans.Runtime.Abstractions.dll
Package:
Microsoft.Orleans.Runtime v10.0.0
Package:
Microsoft.Orleans.Runtime.Abstractions v2.4.5
Package:
Microsoft.Orleans.Runtime.Abstractions v3.6.5
Package:
Microsoft.Orleans.Runtime v7.2.5
Package:
Microsoft.Orleans.Runtime v8.0.0
Package:
Microsoft.Orleans.Runtime v8.1.0
Package:
Microsoft.Orleans.Runtime v8.2.0
Package:
Microsoft.Orleans.Runtime v9.0.0
Package:
Microsoft.Orleans.Runtime v9.1.2
Source:
IPersistentState.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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