Table of Contents

Interface IDaprConnectionRepository

Namespace
Virtufin.WebSocketManager.Services
Assembly
Virtufin.WebSocketManager.dll

Repository for persisting WebSocket connections to Dapr state store.

public interface IDaprConnectionRepository

Methods

ClearAllAsync(CancellationToken)

Clears all connections from the state store. Used on startup with opt-in flag.

Task ClearAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

DeleteAsync(string, CancellationToken)

Deletes a connection entry from the state store.

Task DeleteAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The connection ID to delete.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the asynchronous operation.

GetAllAsync(CancellationToken)

Gets all stored connection entries.

Task<IEnumerable<DaprStateStoreEntry>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IEnumerable<DaprStateStoreEntry>>

A collection of all stored connection entries.

GetAsync(string, CancellationToken)

Gets a connection entry by its ID.

Task<DaprStateStoreEntry?> GetAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The connection ID.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<DaprStateStoreEntry>

The connection entry if found, otherwise null.

GetByInstanceIdAsync(string, CancellationToken)

Gets all connection entries owned by a specific instance.

Task<IEnumerable<DaprStateStoreEntry>> GetByInstanceIdAsync(string instanceId, CancellationToken cancellationToken = default)

Parameters

instanceId string
cancellationToken CancellationToken

Returns

Task<IEnumerable<DaprStateStoreEntry>>

SaveAsync(DaprStateStoreEntry, CancellationToken)

Saves a connection entry to the state store.

Task SaveAsync(DaprStateStoreEntry entry, CancellationToken cancellationToken = default)

Parameters

entry DaprStateStoreEntry

The connection entry to save.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the asynchronous operation.