-
Notifications
You must be signed in to change notification settings - Fork 2k
/
IMemoryStorageGrain.cs
29 lines (26 loc) · 1.74 KB
/
IMemoryStorageGrain.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Threading.Tasks;
namespace Orleans.Storage
{
/// <summary>
/// Grain interface for internal memory storage grain used by Orleans in-memory storage provider.
/// </summary>
public interface IMemoryStorageGrain : IGrainWithIntegerKey
{
/// <summary>Async method to cause retrieval of the specified grain state data from memory store.</summary>
/// <param name="stateStore">The name of the store that is used to store this grain state.</param>
/// <param name="grainStoreKey">Store key for this grain.</param>
/// <returns>Value promise for the currently stored grain state for the specified grain.</returns>
Task<IGrainState> ReadStateAsync(string stateStore, string grainStoreKey);
/// <summary>Async method to cause update of the specified grain state data into memory store.</summary>
/// <param name="grainType">Type of the grain</param>
/// <param name="grainId">Grain ID.</param>
/// <param name="grainState">New state data to be stored for this grain.</param>
/// <returns>Completion promise with new eTag for the update operation for stored grain state for the specified grain.</returns>
Task<string> WriteStateAsync(string grainType, string grainId, IGrainState grainState);
/// <param name="stateStore">The name of the store that is used to store this grain state.</param>
/// <param name="grainStoreKey">Store key for this grain.</param>
/// <param name="eTag">The previous etag that was read.</param>
/// <returns>Completion promise for the update operation for stored grain state for the specified grain.</returns>
Task DeleteStateAsync(string stateStore, string grainStoreKey, string eTag);
}
}