feat: add WitnessLatestOn, run sequencers from a TimeProvider, add a shared IsImmediate check - #220
Merged
glennawatson merged 1 commit intoSep 21, 2026
Conversation
…shared IsImmediate check - `WitnessLatestOnSignal<T>` and `WitnessLatestOn(sequencer)` deliver only the newest queued value when hopping to a sequencer. - `WitnessLatestOnSignal<T>` is a public sink under Advanced that you construct directly, and it delivers outside its lock. - `ThreadPoolSequencer`, `TaskPoolSequencer`, `SynchronizationContextSequencer`, `WasmSequencer`, `ImmediateSequencer` and `CurrentThreadSequencer` take a `TimeProvider`. - Time-based operators run from a `TimeProvider` through the sequencer they are given. - `VirtualClock` is a `TimeProvider`, so a test drives time from a fake provider or a virtual clock. - `WasmScheduler` in the Reactive package takes a `TimeProvider`. - `SequencerImmediacyExtensions.IsImmediate` reports whether a sequencer is the immediate one, in both the lean and Reactive packages. - Internal immediacy checks use `IsImmediate`. - Public API baselines cover every target framework of both packages, Apple and Android included. - The README documents the new members.
ChrisPulman
approved these changes
Sep 21, 2026
|
glennawatson
deleted the
feat/sequencer-latest-value-time-provider-immediate
branch
September 21, 2026 11:52
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #220 +/- ##
========================================
Coverage 99.78% 99.78%
========================================
Files 781 785 +4
Lines 24558 24774 +216
Branches 2886 2910 +24
========================================
+ Hits 24504 24720 +216
Misses 54 54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Sequencers run from a
TimeProvider, hopping to a sequencer can deliver only the newest value, and one check tells you whether a sequencer is immediate.WitnessLatestOn(sequencer)delivers only the newest value. You get the latest value instead of a replay of every queued one.WitnessLatestOnSignal<T>is a public sink under Advanced. You construct it directly, like the other operator sinks.TimeProvider. The time-based operators that take a sequencer run from that provider.VirtualClockis aTimeProvider. A test drives time from a fake provider or from aVirtualClock.WasmSchedulerin the Reactive package takes aTimeProvider.sequencer.IsImmediatetells you whether a sequencer is the immediate one. It works in both the lean and the Reactive packages.Why
A two-way binding through a queuing sequencer livelocked in ReactiveUI.Binding, because
WitnessOnreplays every queued value. Binding also could not driveThrottle(TimeSpan, ISequencer)from aTimeProviderfake clock, and comparing a scheduler toSequencer.Immediatemisses the Reactive package's immediate scheduler.Breaking changes
None.
How this was verified
Tests cover every type this adds and every changed sequencer, and they drive time with
VirtualClock.Notes for the reviewer
Start with
WitnessLatestOnSignal{T}.csand the sequencer constructors. The public API baselines are generated.Checklist