Table of Contents

Method CommitAsync

Namespace
MailFathom.Application.Persistence
Assembly
MailFathom.Application.dll

CommitAsync(Func<IPersistenceSession, CancellationToken, Task>, CancellationToken)

Stages and commits a complete local write in a fresh session for every attempt.

public Task CommitAsync(Func<IPersistenceSession, CancellationToken, Task> stageChangesAsync, CancellationToken cancellationToken)

Parameters

stageChangesAsync Func<IPersistenceSession, CancellationToken, Task>

Stages the complete idempotent local write in the supplied session.

cancellationToken CancellationToken

Cancels session creation, staging, commit, or a subsequent retry.

Returns

Task

A task that completes once one attempt has committed.

Exceptions

PersistenceConcurrencyConflictException

Thrown when every allowed attempt conflicted.

OperationCanceledException

Thrown when the caller cancels before or between attempts.