Expand description
A future-based worker that for each input, one output is produced.
§Example
use gloo_worker::oneshot::oneshot;
use gloo_worker::Spawnable;
#[oneshot]
async fn Squared(input: u32) -> u32 {
input.pow(2)
}
// consuming the worker
let mut squared_bridge = Squared::spawner().spawn("...");
assert_eq!(squared_bridge.run(2).await, 4);
Structs§
- Oneshot
Bridge - A connection manager for components interaction with oneshot workers.
- Oneshot
Registrar - A registrar for oneshot workers.
- Oneshot
Spawner - A spawner to create oneshot workers.
Traits§
- Oneshot
- A future-based worker that for each input, one output is produced.
Attribute Macros§
- oneshot
- Creates an oneshot worker.