smol-rs / async-io

Async I/O and timers
Apache License 2.0
416 stars 62 forks source link

Optionally disable timers or Asyncs on features #89

Open notgull opened 1 year ago

notgull commented 1 year ago

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:

This would be a breaking change.

taiki-e commented 1 year ago

I'm not sure if we need to introduce such a breaking change to support WASM. Currently, async-io fails to compile on WASM anyway, so I think just disabling some APIs in WASM is not a problem.

notgull commented 1 year ago

That's probably the best way of going about this. I'll rearrange the PR I wrote to use OS flags instead of feature flags.

notgull commented 1 year ago

A few points of note I discovered while implementing this:

notgull commented 5 months ago

Not relevant for now