# MemoryGrainStorageWithLatency

Package: [Microsoft.Orleans.Persistence.Memory](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Persistence.Memory) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Persistence.Memory/Storage/MemoryStorageWithLatency.cs#L47)

```csharp
public class MemoryGrainStorageWithLatency : IGrainStorage
```

This is a simple in-memory implementation of a storage provider which presents fixed latency of storage calls. This class is useful for system testing and investigation of the effects of storage latency.

## Remarks

This storage provider is ONLY intended for simple in-memory 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

- [MemoryGrainStorageWithLatency(string, MemoryStorageWithLatencyOptions, ILoggerFactory, IGrainFactory, IActivatorProvider, IGrainStorageSerializer)](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/constructors/constructor-string-orleans-storage-memorystoragewithlatencyoptions-microsoft-ext-9e27e43a/)

## Methods

- [ClearStateAsync(string, GrainId, IGrainState&lt;T&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/clearstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-3e72e626/)
- [ReadStateAsync(string, GrainId, IGrainState&lt;T&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/readstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-f9400a59/)
- [WriteStateAsync(string, GrainId, IGrainState&lt;T&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/writestateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-38415bc8/)
