AuthorityCallTracker
The sender's side of the reply channel: the calls this worker sent with a reply requested and has not heard back about.
Nebula · Packages/com.1by3.nebula/Runtime/Worker/AuthorityCallContract.cspublic sealed class AuthorityCallTrackerThe sender's side of the reply channel: the calls this worker sent with a reply requested and has not heard back about. Each settles exactly once, with the reply that arrives or with AuthorityCallOutcome.TimedOut when Expire passes its deadline.
Constructors
AuthorityCallTracker
public AuthorityCallTracker(ushort workerIndex, ulong initialSequence = 0);| Parameter | Description |
|---|---|
workerIndex | This worker's index, the top bits of every id minted here. |
initialSequence | Where the sequence starts; see AuthorityCallId.InitialSequence. |
Properties
WorkerIndex
public ushort WorkerIndex { get; }The index of the worker minting ids here.
PendingCount
public int PendingCount { get; }Calls awaiting a reply.
LateReplies
public long LateReplies { get; }Replies that arrived for a call no longer pending (settled, timed out, or never tracked).
Methods
Mint
public ulong Mint();A fresh call id for a call this worker is about to send.
Track
public void Track(ulong callId, uint deadlineTick, Action<AuthorityCallResult> onDone);Wait for the reply to callId; onDone runs once, at the reply or at deadlineTick.
Complete
public bool Complete(ulong callId, in AuthorityCallResult result);Settle callId with result. False when it was not pending (the reply is counted in LateReplies).
IsPending
public bool IsPending(ulong callId);Whether callId still awaits a reply.
Expire
public void Expire(uint tick);Settle every call whose deadline is at or before tick as AuthorityCallOutcome.TimedOut. Call once a tick.
Clear
public void Clear();Drop every pending call without running its callback.