<PackageReference Include="ReactiveUI.Primitives" Version="10.0.0" />

ReactiveUI.Primitives.Advanced.DispatchSequencerState

Queues immediate work into posted batches and schedules delayed work through the supplied delegates.
public static DateTimeOffset Now { get; }

Gets the sequencer's notion of current time.

public static long Timestamp { get; }

Gets the sequencer's monotonic timestamp.

public DispatchSequencerState(ISequencer owner, Func<Action, bool> post, Action drain)

Initializes a new instance of the DispatchSequencerState struct using the shared thread-pool timer for delayed work.

public DispatchSequencerState(ISequencer owner, Func<Action, bool> post, Action drain, Action<IWorkItem, long> scheduleDelayed)

Initializes a new instance of the DispatchSequencerState struct.

public static TimeSpan DelayUntil(long dueTimestamp)

Gets the delay from the sequencer's current time until the given monotonic timestamp.

public static void RunIfActive(IWorkItem item)

Executes the work item on the current (dispatcher) thread unless it has been cancelled.

public bool Equals(DispatchSequencerState other)

public void PostDrain()

Attempts to post a drain if queued work is waiting.

public void RunDrain()

Runs one dispatcher batch.

public void Schedule(IWorkItem item)

Schedules a work item to be executed on the dispatcher.

public void Schedule(IWorkItem item, long dueTimestamp)

Schedules a work item to be executed on the dispatcher at a monotonic timestamp.