Table of Contents

Interface IPublicationStateStore

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

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

keys IReadOnlyList<string>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<StoredItem>>

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

key string
json string
cancellationToken CancellationToken

Returns

Task<bool>

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

writes IReadOnlyList<StoredWrite>
cancellationToken CancellationToken

Returns

Task<bool>