Table of Contents

Method ReadAsync

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

ReadAsync(DiscoveryRunId, UserId, long, DateTimeOffset, CancellationToken)

Reads a run this user started, from a stated point, and records that it was read.

Task<DiscoveryRunReading?> ReadAsync(DiscoveryRunId id, UserId user, long afterSequence, DateTimeOffset now, CancellationToken cancellationToken)

Parameters

id DiscoveryRunId

The run the caller is reading.

user UserId

The user the caller was admitted for.

afterSequence long

The last sequence the caller already holds, or 0 to read the run from its beginning.

now DateTimeOffset

The instant of the read, which the retention window is measured from.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<DiscoveryRunReading>

The run's standing and everything after that point, or null where this user has no such run.

Remarks

A sequence this run has not reached reads as the beginning rather than as a point to wait at, which is the safe direction: no client can hold one honestly, so what such a value means is a cursor belonging to some other run, and replaying costs a few events where honouring it would hand back a run missing everything before the number. A run belonging to somebody else is reported as no such run, exactly as one that never existed is.