Table of Contents

Class DiscoveryRunJournal

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

Writes one run's answer down as it is composed, and says over the hub how far it has got.

public sealed class DiscoveryRunJournal : IDisposable
Inheritance
DiscoveryRunJournal
Implements
Inherited Members

Remarks

A run outlives the request that asked the question, and above one replica it outlives the process too: the client reading it is routed wherever the load balancer likes. So the run's output is written into PostgreSQL where it is produced and read back from there over an ordinary route, which is ADR 0035. This is the writing half: the execution holds one of these and appends to it, and nothing about the reading half passes through here.

The signal says where to read, never what was read. Each write is announced to the owner's group as the run and the sequence it reached, so every screen that person has open is told rather than only the one that asked. It carries no part of the answer, because the backplane a deployment may point that fan-out at is one an operator is permitted to have somebody else run — and a block quotes mail. A signal that never arrives costs nothing: the row is the guarantee and the client's own re-read is what reaches it.

It also owns the token a stop arrives on. A stop reaches a run two ways and both end here: a request that landed on this replica asks it directly, and one that landed on another replica is recorded against the run, which this discovers the first time the store refuses a write. Either way the token is cancelled, the execution abandons the provider call and the retrieval it was waiting on, and the ending the run then writes carries the counts that execution actually spent.

Constructors

DiscoveryRunJournal(DiscoveryRunId, UserId, IDiscoveryRunStore, ClientSignals, TimeProvider)

Initializes the journal of one run that has already been opened in the store.

Properties

HasEnded

Gets whether this execution has written the run's ending, after which it writes nothing further.

Id

Gets the identifier the run is addressed by.

Stopping

Gets the token a stop reaches the execution through, which the run links its own cancellation to.

User

Gets whose mail the run reads.

Methods

AppendAsync(DiscoveryRunEvent, CancellationToken)

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

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RequestStop()

Asks the execution to stop, so it makes no further provider call and abandons the retrieval it is waiting on.