| Crates.io | rx_core_operator_subscribe_on |
| lib.rs | rx_core_operator_subscribe_on |
| version | 0.2.0 |
| created_at | 2026-01-22 19:43:32.309628+00 |
| updated_at | 2026-01-24 15:09:58.40678+00 |
| description | subscribe_on operator for rx_core |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2062453 |
| size | 17,197 |
The subscribe_on operator schedules the subscription to the upstream
observable on the provided scheduler.
This only affects when the upstream subscription starts. It does not alter
when upstream next, error, or complete signals are emitted.
The subscription can be delayed with subscribe_on_with_delay.
cargo run -p rx_core --example operator_subscribe_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()
.subscribe_on(scheduler)
.subscribe(PrintObserver::new("subscribe_on_operator"));
executor.tick(Duration::from_millis(0));
}
Output:
Ticking... (0ns)
subscribe_on_operator - next: 1
subscribe_on_operator - next: 2
subscribe_on_operator - next: 3
subscribe_on_operator - completed
subscribe_on_operator - unsubscribed