Bewerken

Delen via


MemoryGrainStorage Class

Definition

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

public class MemoryGrainStorage : IDisposable, Orleans.Storage.IGrainStorage
type MemoryGrainStorage = class
    interface IGrainStorage
    interface IDisposable
Public Class MemoryGrainStorage
Implements IDisposable, IGrainStorage
Inheritance
MemoryGrainStorage
Implements

Examples

Example configuration for this storage provider in OrleansConfiguration.xml file:

<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <StorageProviders>
      <Provider Type="Orleans.Storage.MemoryStorage" Name="MemoryStore" />
  </StorageProviders>

Remarks

This storage provider is ONLY intended for simple in-memory Development / Unit Test scenarios. This class should NOT be used in Production environment, because [by-design] it does not provide any resilience or long-term persistence capabilities.

Constructors

MemoryGrainStorage(String, MemoryGrainStorageOptions, ILogger<MemoryGrainStorage>, IGrainFactory, IGrainStorageSerializer)

Initializes a new instance of the MemoryGrainStorage class.

MemoryGrainStorage(String, MemoryGrainStorageOptions, ILogger<MemoryGrainStorage>, IGrainFactory)

Default constructor.

MemoryGrainStorage(String, MemoryGrainStorageOptions, ILoggerFactory, IGrainFactory)

Default constructor.

Methods

ClearStateAsync(String, GrainReference, IGrainState)

Delete / Clear state data function for this storage provider.

ClearStateAsync<T>(String, GrainId, IGrainState<T>)

Delete / Clear data function for this storage instance.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ReadStateAsync(String, GrainReference, IGrainState)

Read state data function for this storage provider.

ReadStateAsync<T>(String, GrainId, IGrainState<T>)

Read data function for this storage instance.

WriteStateAsync(String, GrainReference, IGrainState)

Write state data function for this storage provider.

WriteStateAsync<T>(String, GrainId, IGrainState<T>)

Write data function for this storage instance.

Applies to