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
cancellationTokenCancellationToken
Returns
DeleteAsync(string, CancellationToken)
Deletes a connection entry from the state store.
Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe connection ID to delete.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the asynchronous operation.
GetAllAsync(CancellationToken)
Gets all stored connection entries.
Task<IEnumerable<DaprStateStoreEntry>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation 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
idstringThe connection ID.
cancellationTokenCancellationTokenCancellation 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
instanceIdstringcancellationTokenCancellationToken
Returns
SaveAsync(DaprStateStoreEntry, CancellationToken)
Saves a connection entry to the state store.
Task SaveAsync(DaprStateStoreEntry entry, CancellationToken cancellationToken = default)
Parameters
entryDaprStateStoreEntryThe connection entry to save.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the asynchronous operation.