Skip to content

MemoryGrainStorage Methods

This is a simple in-memory grain implementation of a storage provider.

ClearStateAsync(string, GrainId, IGrainState<T>)

virtual
View source
public virtual Task ClearStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Delete / Clear data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain
grainIdGrainId
Grain ID
grainStateIGrainState<T>
Copy of last-known state data object for this grain.

Returns

Completion promise for the Delete operation on the specified grain.

Dispose

View source
public void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ReadStateAsync(string, GrainId, IGrainState<T>)

virtual
View source
public virtual Task ReadStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Read data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain
grainIdGrainId
Grain ID
grainStateIGrainState<T>
State data object to be populated for this grain.

Returns

Completion promise for the Read operation on the specified grain.

WriteStateAsync(string, GrainId, IGrainState<T>)

virtual
View source
public virtual Task WriteStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Write data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain
grainIdGrainId
Grain ID
grainStateIGrainState<T>
State data object to be written for this grain.

Returns

Completion promise for the Write operation on the specified grain.