Skip to content

DispatchSpan

Namespace: SideXP.Broadcaster

public sealed class DispatchSpan

The monitor's record of one dispatch (an emit, a cue, an order or an ask): its identity, what was sent, when it began and ended, how it finished, the callbacks it invoked, and the dispatch it happened inside of. A synchronous dispatch opens and closes within a single stack; a cue or async order/ask stays open across frames until its work finishes.

Remarks

The same instance is handed to SpanBegan and later SpanEnded: a recorder can hold it and read the end fields once IsComplete is set. Only produced in the editor and development builds; release builds never produce one.

Properties

Id

public long Id

A bus-unique, increasing id for this dispatch.

Kind

public EventKind Kind

The kind of event dispatched.

EventType

public Type EventType

The exact event type dispatched.

Payload

public PayloadSnapshot Payload

A stringified snapshot of the payload, taken at send time. Never a live reference.

Parent

public DispatchSpan Parent

The dispatch this one happened inside of, or null for a top-level dispatch. Guaranteed for synchronous cascades (a listener that emits); best-effort across async continuations, where temporal containment still holds even without a hard link.

BeginFrame

public int BeginFrame

The frame the dispatch began on.

BeginTime

public double BeginTime

The realtime (seconds since startup) the dispatch began at.

EndFrame

public int EndFrame

The frame the dispatch ended on. Meaningful once IsComplete is true.

EndTime

public double EndTime

The realtime (seconds since startup) the dispatch ended at. Meaningful once IsComplete is true.

Outcome

public DispatchOutcome Outcome

How the dispatch finished. Meaningful once IsComplete is true.

IsComplete

public bool IsComplete

Whether the dispatch has finished (its end fields and Outcome are set).

Listeners

public IReadOnlyList<ListenerSpan> Listeners

The callbacks invoked by this dispatch, one sub-span each, in invocation order.