Interface IStateStore
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Provides the functionalities of a distributed state store.
public interface IStateStore
Methods
DeleteBulkStateAsync(IReadOnlyList<BulkStateStoreItem>, CancellationToken)
Deletes a list of items from the state store.
Task DeleteBulkStateAsync(IReadOnlyList<BulkStateStoreItem> items, CancellationToken cancellationToken = default)
Parameters
itemsIReadOnlyList<BulkStateStoreItem>The list of items to delete.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
DeleteStateAsync(string, StateStoreConsistency, StateStoreConcurrency, CancellationToken)
Deletes the value associated with the provided key in the state store.
Task DeleteStateAsync(string key, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, StateStoreConcurrency stateStoreConcurrency = StateStoreConcurrency.LastWrite, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
stateStoreConsistencyStateStoreConsistencystateStoreConcurrencyStateStoreConcurrencyThe concurrency mode StateStoreConcurrency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
GetStateAsync<TValue>(string, StateStoreConsistency, CancellationToken)
Gets the current value associated with the key from the state store.
Task<(TValue? Value, string ETag)> GetStateAsync<TValue>(string key, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
stateStoreConsistencyStateStoreConsistencyThe consistency mode StateStoreConsistency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<(TValue Value, string ETag)>
A Task<TResult> that will return the value when the operation has completed.
Type Parameters
TValueThe data type of the value to read.
SaveBulkStateAsync<TValue>(IReadOnlyList<BulkStateStoreItem<TValue>>, CancellationToken)
Saves a list of items to the state store.
Task SaveBulkStateAsync<TValue>(IReadOnlyList<BulkStateStoreItem<TValue>> items, CancellationToken cancellationToken = default)
Parameters
itemsIReadOnlyList<BulkStateStoreItem<TValue>>The list of items to save.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TValueThe type of the data that will be JSON serialized and stored in the state store.
SaveStateAsync<TValue>(string, TValue, StateStoreConsistency, StateStoreConcurrency, CancellationToken)
Saves the provided value associated with the provided key to the state store.
store.
Task SaveStateAsync<TValue>(string key, TValue value, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, StateStoreConcurrency stateStoreConcurrency = StateStoreConcurrency.LastWrite, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
valueTValueThe data that will be JSON serialized and stored in the state store.
stateStoreConsistencyStateStoreConsistencyThe consistency mode StateStoreConsistency.
stateStoreConcurrencyStateStoreConcurrencyThe concurrency mode StateStoreConcurrency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TValueThe type of the data that will be JSON serialized and stored in the state store.
SaveStateAsync<TValue>(string, TValue, StateStoreSaveOptions, StateStoreConsistency, StateStoreConcurrency, CancellationToken)
Saves the provided value associated with the provided key to the state store.
store.
Task SaveStateAsync<TValue>(string key, TValue value, StateStoreSaveOptions saveOptions, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, StateStoreConcurrency stateStoreConcurrency = StateStoreConcurrency.LastWrite, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
valueTValueThe data that will be JSON serialized and stored in the state store.
saveOptionsStateStoreSaveOptionsThe save options StateStoreSaveOptions.
stateStoreConsistencyStateStoreConsistencyThe consistency mode StateStoreConsistency.
stateStoreConcurrencyStateStoreConcurrencyThe concurrency mode StateStoreConcurrency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TValueThe type of the data that will be JSON serialized and stored in the state store.
TrySaveStateAsync<TValue>(string, TValue, string, StateStoreConsistency, StateStoreConcurrency, CancellationToken)
Tries to save the statevalue associated with the providedkey using the etag to the state store.
Task<bool> TrySaveStateAsync<TValue>(string key, TValue value, string etag, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, StateStoreConcurrency stateStoreConcurrency = StateStoreConcurrency.LastWrite, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
valueTValueThe data that will be JSON serialized and stored in the state store.
etagstringThe etag.
stateStoreConsistencyStateStoreConsistencyThe consistency mode StateStoreConsistency.
stateStoreConcurrencyStateStoreConcurrencyThe concurrency mode StateStoreConcurrency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TValueThe type of the data that will be JSON serialized and stored in the state store.
TrySaveStateAsync<TValue>(string, TValue, string, StateStoreSaveOptions, StateStoreConsistency, StateStoreConcurrency, CancellationToken)
Tries to save the statevalue associated with the providedkey using the etag to the state store.
Task<bool> TrySaveStateAsync<TValue>(string key, TValue value, string etag, StateStoreSaveOptions saveOptions, StateStoreConsistency stateStoreConsistency = StateStoreConsistency.Strong, StateStoreConcurrency stateStoreConcurrency = StateStoreConcurrency.LastWrite, CancellationToken cancellationToken = default)
Parameters
keystringThe state key.
valueTValueThe data that will be JSON serialized and stored in the state store.
etagstringThe etag.
saveOptionsStateStoreSaveOptionsThe save options StateStoreSaveOptions.
stateStoreConsistencyStateStoreConsistencyThe consistency mode StateStoreConsistency.
stateStoreConcurrencyStateStoreConcurrencyThe concurrency mode StateStoreConcurrency.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TValueThe type of the data that will be JSON serialized and stored in the state store.