pub struct TestSequencer { /* private fields */ }Expand description
Two participants of a test that wait for each other phase by phase: each calls
advance_phase_async at the end of its part of a phase, and the
phase completes when both have (TestSequencer, a Barrier of two participants).
Deviation (DEVIATIONS.md, ReactiveUI): the observables are single-threaded, so the two
participants are two tasks of the current thread instead of two threads: the task of the first
participant to arrive ends when the second one arrives, and the task of the second one has
ended when advance_phase_async returns. The continuations of a
task run when it ends, so upstream’s Task.Yield() after the barrier has no counterpart.
Implementations§
Source§impl TestSequencer
impl TestSequencer
Sourcepub fn completed_phases(&self) -> i64
pub fn completed_phases(&self) -> i64
The number of phases both participants completed (CompletedPhases).
Sourcepub fn current_phase(&self) -> i64
pub fn current_phase(&self) -> i64
The phase the participants are in, set when the first of them arrives (CurrentPhase).
Sourcepub fn advance_phase_async(&self) -> Task<()> ⓘ
pub fn advance_phase_async(&self) -> Task<()> ⓘ
Ends the part of the current phase of the calling participant; the task ends when the other
participant has ended its part too (AdvancePhaseAsync()).
Sourcepub fn advance_phase_async_with(&self, comment: &str) -> Task<()> ⓘ
pub fn advance_phase_async_with(&self, comment: &str) -> Task<()> ⓘ
advance_phase_async, with a comment that names the phase for
the reader of the test (AdvancePhaseAsync(string)).
§Panics
When the sequencer is disposed, where upstream’s barrier throws ObjectDisposedException.