Table of Contents

Class DiscoveryRunEvent

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

One thing that happened during a Discover run, named against the run and placed in its order.

[JsonPolymorphic(TypeDiscriminatorPropertyName = "event")]
[JsonDerivedType(typeof(DiscoveryRunStarted), "started")]
[JsonDerivedType(typeof(DiscoveryRetrievalProgressed), "retrieval")]
[JsonDerivedType(typeof(DiscoveryCitationDeclared), "citation")]
[JsonDerivedType(typeof(DiscoveryBlockComposed), "block")]
[JsonDerivedType(typeof(DiscoveryRunCompleted), "completed")]
[JsonDerivedType(typeof(DiscoveryRunFailed), "failed")]
public abstract record DiscoveryRunEvent : IEquatable<DiscoveryRunEvent>
Inheritance
DiscoveryRunEvent
Implements
Derived
Inherited Members

Remarks

The contract a client renders a run from. It is closed by a private protected constructor, so the six events declared beside it are the whole of it and a client that handles those six handles every run this build produces.

Every event names its run and its place in it. The sequence is assigned where the event is written rather than by whatever composed it, starts at one, and increases by one — so a client renders in arrival order without sorting, and a client holding a cursor asks for everything after the last sequence it read. That is the whole of the resumption contract: no event is written a second time under a different number and none is skipped. It is exact from any replica, because what the cursor addresses is rows rather than a buffer in the process that composed them.

The run is the plan, written as it becomes ready. The start says which revision of the presentation contract the run writes; each source is declared before the block that names it; and the ending says what the run knows about its own reach. A client assembling those has what a whole PresentationPlan would have carried, and a run that failed after two blocks leaves those two on the screen rather than nothing.

A block and a citation are composed from somebody's correspondence and are sensitive throughout. They belong in the run's own rows and in the response that reads them back, and nowhere else — never in a log line, a span attribute, an exception message, or the signal that says a run advanced. The four other events carry counts and closed values alone, which is what makes a run observable without any of it.

Properties

EndsTheRun

Gets whether this event ends the run, after which nothing further is published for it.

EventName

Gets the name this event is published under, which is the value the type discriminator carries.

RunId

Gets the run this happened in.

Sequence

Gets the place this holds in the run, counted from one.