WASM targets don't support Async and probably won't until WASI reaches a more stable point. However, since parking is usable on WASM thanks to atomics, it may be desirable to use the Timer implementation.
My suggestion is to add two new features: io and timers. They compose as such:
- With both features enabled (they are by default), the crate functions as normal.
- With
io disabled but timers enabled, the Reactor retains its timer processing capabilities but instead of calling to polling, it calls parking (which works with WASM) with the timeout resulting from process_timer_ops.
- With both features disabled,
Reactor no longer exists and block_on is just an alias to the ones in futures_lite.
This would be a breaking change.
WASM targets don't support
Asyncand probably won't until WASI reaches a more stable point. However, sinceparkingis usable on WASM thanks to atomics, it may be desirable to use theTimerimplementation.My suggestion is to add two new features:
ioandtimers. They compose as such:iodisabled buttimersenabled, theReactorretains its timer processing capabilities but instead of calling topolling, it callsparking(which works with WASM) with the timeout resulting fromprocess_timer_ops.Reactorno longer exists andblock_onis just an alias to the ones infutures_lite.This would be a breaking change.