Table of Contents

Method AppendAsync

Namespace
MailFathom.Application.Discovery.Streaming
Assembly
MailFathom.Application.dll

AppendAsync(DiscoveryRunEvent, CancellationToken)

Writes one event, which the store places in the run and stamps with its sequence.

public Task<bool> AppendAsync(DiscoveryRunEvent @event, CancellationToken cancellationToken)

Parameters

event DiscoveryRunEvent

What happened, carrying neither a run nor a sequence of its own.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<bool>

true when the event was written; false when the run is over and this execution should stop.

Remarks

A refusal is the run being over rather than a failure to retry: it has been asked to stop, it has already published an ending, it has no room left for anything but one, or it has been forgotten. All four mean the same thing to an execution, so the token is cancelled here and the caller ends the run rather than deciding which it was.

The write is deliberately not bounded by the request that started the run — there is no such request left by the time most of these happen — and the ending is written even while the deployment is stopping, because a run left pending is one a client watches until the ceiling forgets it.

Exceptions

ArgumentNullException

Thrown when event is null.