Skip to content

IProgressSequence

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Progress

IProgressSequence Interface

Provides globally-ordered sequence numbers for progress events across all concurrent orchestrations. Registered as a singleton in DI so all IProgressReporter instances share a single monotonic counter.

public interface IProgressSequence

Example

var seq = serviceProvider.GetRequiredService<IProgressSequence>();
var first = seq.Next();  // e.g., 1
var second = seq.Next(); // e.g., 2 — guaranteed > first

Remarks

Sequence numbers establish a total order across events from different agents, workflows, and threads. This is useful for reconstructing the timeline of a multi-agent orchestration from interleaved event streams.

Methods

IProgressSequence.Next() Method

Allocates the next globally-ordered sequence number. Thread-safe and guaranteed to return a value greater than all previously returned values.

long Next();

Returns

System.Int64