Table of Contents

Method MovePhaseAsync

Namespace
MailFathom.Application.Accounts.Custody
Assembly
MailFathom.Application.dll

MovePhaseAsync(IPersistenceSession, MailAccountId, MailAccountCustodyPhase, MailAccountCustodyPhase, CancellationToken)

Moves one account's phase, but only from the phase it was decided from.

Task<bool> MovePhaseAsync(IPersistenceSession session, MailAccountId account, MailAccountCustodyPhase decidedFrom, MailAccountCustodyPhase moveTo, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The transaction the move commits in.

account MailAccountId

The account.

decidedFrom MailAccountCustodyPhase

The phase the caller read before deciding.

moveTo MailAccountCustodyPhase

The phase to write.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<bool>

true when the account still stood at decidedFrom and the phase was written.

Remarks

A refused move is an ordinary answer: another replica moved the account, and this one re-reads rather than writing over it.