Module gloo_worker::oneshot
source · 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
- A connection manager for components interaction with oneshot workers.
- A registrar for oneshot workers.
- A spawner to create oneshot workers.
Traits
- A future-based worker that for each input, one output is produced.
Attribute Macros
- Creates an oneshot worker.