rx_core_operator_observe_on

Crates.iorx_core_operator_observe_on
lib.rsrx_core_operator_observe_on
version0.2.0
created_at2026-01-21 10:16:06.827928+00
updated_at2026-01-24 15:08:44.643939+00
descriptionobserve_on operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2058799
size21,095
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_observe_on

crates.io ci codecov license

The observe_on operator re-emits upstream next signals on the provided scheduler.

Upstream completion and cancellation happen immediately when there are no pending scheduled values, otherwise they are deferred until scheduled work drains.

Upstream errors are forwarded immediately; any pending scheduled values are skipped because downstream closes.

See Also

Example

cargo run -p rx_core --example operator_observe_on_example
use std::time::Duration;

use rx_core::prelude::*;
use rx_core_testing::MockExecutor;

fn main() {
    let mut executor = MockExecutor::new_with_logging();
    let scheduler = executor.get_scheduler_handle();

    let _subscription = (1..=3)
        .into_observable()
        .observe_on(scheduler)
        .subscribe(PrintObserver::new("observe_on_operator"));

    executor.tick(Duration::from_millis(1));
}

Output:

Ticking... (0ns)
observe_on_operator - next: 1
observe_on_operator - next: 2
observe_on_operator - next: 3
observe_on_operator - completed
observe_on_operator - unsubscribed
Commit count: 652

cargo fmt