Module workflow_rs::core::task
source · Expand description
task
module provides helper functions for use with async closures that operate uniformly
in native (tokio
-backed) and WASM ([async_std
]-backed) environments
(i.e. a web browser).
Following functions are are available:
spawn()
- non-blocking spawn of the supplied async closuresleep()
- suspends the task for a given Durationyield_now()
- yields rust executoryield_executor()
- yields to top-level executor (browser async loop)
Blocking spawn is not available as a part of this framework as WASM-browser environment can not block task execution due to a single-threaded async application environment.
Modules
- WASM implementation
Macros
Structs
Functions
async interval()
function backed by the JavaScriptcreateInterval()
- Waits until
duration
has elapsed. - Yields execution back to the Tokio runtime.
- Yields execution back to the Tokio runtime.