Interface IPublicationStateStore
The state operations fenced publication needs, and nothing provider specific: bulk read with ETags, create-if-absent, and an all-or-nothing transaction whose writes may be ETag-guarded. Any Dapr state store with the ETAG and TRANSACTIONAL capabilities provides them.
public interface IPublicationStateStore
Methods
GetAsync(IReadOnlyList<string>, CancellationToken)
Reads keys; the result has one item per key, in the same order.
Task<IReadOnlyList<StoredItem>> GetAsync(IReadOnlyList<string> keys, CancellationToken cancellationToken)
Parameters
keysIReadOnlyList<string>cancellationTokenCancellationToken
Returns
TryCreateAsync(string, string, CancellationToken)
Writes key only if it does not exist; false if it does.
Task<bool> TryCreateAsync(string key, string json, CancellationToken cancellationToken)
Parameters
keystringjsonstringcancellationTokenCancellationToken
Returns
TryTransactAsync(IReadOnlyList<StoredWrite>, CancellationToken)
Applies all writes or none; false if a guarded key's ETag no longer matches.
Task<bool> TryTransactAsync(IReadOnlyList<StoredWrite> writes, CancellationToken cancellationToken)
Parameters
writesIReadOnlyList<StoredWrite>cancellationTokenCancellationToken