Crate wasm_ticker
source ·Expand description
Non-block tick executor for WebAssembly Rust.
Ticker callbacks queue as Tasks to JavaScript event loop. Instead of Microtasks or just stacking in, Tasks won’t block current host context and UI rendering thread. See also https://developer.mozilla.org/docs/Web/API/HTML_DOM_API/Microtask_guide/in_depth
Ticker | API | Platform | Interval Browser / Node |
---|---|---|---|
MessageChannelTicker | Channel Messaging | * | >4µs / <1µs |
ImmediateTicker | setImmediate | Node | ~1µs |
TimeoutTicker | setTimeout | * | ~4ms / ~14ms |
AnimationFrameTicker | requestAnimationFrame | Browser | According to device |
AutoTicker | One of above | * | N/A |
Modules§
- Factory types implement TickerFactory
- Types implement Ticker
Enums§
- Running state of Ticker
Traits§
- Ticker with specialized JavaScript API.
- Tickers using JavaScript timer APIs.