Düzenle

Aracılığıyla paylaş


MemoryStorage Class

Definition

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

public class MemoryStorage : Orleans.Storage.IStorageProvider
type MemoryStorage = class
    interface IStorageProvider
    interface IProvider
Public Class MemoryStorage
Implements IStorageProvider
Inheritance
MemoryStorage
Derived
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

MemoryStorage()

Default constructor.

MemoryStorage(Int32)

Constructor - use the specificed number of store grains.

Fields

NumStorageGrainsDefaultValue

Default number of queue storage grains.

NumStorageGrainsPropertyName

Config string name for number of queue storage grains.

Properties

Log

Logger used by this storage provider instance.

Name

Name of this storage provider instance.

Methods

ClearStateAsync(String, GrainReference, IGrainState)

Delete / Clear state data function for this storage provider.

Close()

Shutdown function for this storage provider.

Init(String, IProviderRuntime, IProviderConfiguration)

Initialization function for this storage provider.

ReadStateAsync(String, GrainReference, IGrainState)

Read state data function for this storage provider.

WriteStateAsync(String, GrainReference, IGrainState)

Write state data function for this storage provider.

Applies to