pub trait AsyncTaskSpawner: Send + Sync {
// Required method
fn spawn(&self, task: AsyncFnToSpawn);
}Expand description
Used to run an async function.
In the browser this will typically schedule the future to be called on the next tick of the JS microtask queue.
Outside of JS this will often spawn the task in a thread.
Required Methods§
Sourcefn spawn(&self, task: AsyncFnToSpawn)
fn spawn(&self, task: AsyncFnToSpawn)
Run an async function, typically in another thread or, if in the browser, on another tick of the JS event loop.