Skip to content

Enable usage of timers on WASM #89

Open
@notgull

Description

@notgull

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions