This wasi-poll repository has been subsumed by wasi-io.
Its contents, including the specification of the poll-oneff
function, which has been renamed
to poll-list
, has moved there.
A proposed WebAssembly System Interface API.
WASI-poll is currently in Phase 2.
- Dan Gohman
WASI poll must have host implementations which can pass the testsuite on at least Windows, macOS, and Linux.
WASI poll must have at least two complete independent implementations.
- Introduction
- Goals
- Non-goals
- API walk-through
- Detailed design discussion
- Considered alternatives
- Stakeholder Interest & Feedback
- References & acknowledgements
WASI Poll is a WASI API for waiting for I/O events on multiple handles.
It is similar in spirit to the POSIX poll
function.
The primary goal of WASI Poll is to allow users to use WASI programs to be able to wait for stream read, stream write, stream error, and clock timeout events, on multiple handles.
WASI Poll is not yet aiming to support large numbers of handles efficiently.
Future proposals will ideally add something similar to Linux's epoll
, but
that is not yet addressed.
[Walk through of how someone would use this API.]
[Provide example code snippets and diagrams explaining how the API would be used to solve the given problem]
[etc.]
[This section should mostly refer to the .wit.md file that specifies the API. This section is for any discussion of the choices made in the API which don't make sense to document in the spec file itself.]
This is referencing the fact that this function is not efficient when used repeatedly with the same large set of handles. In the future, it is expected that follow-up proposals will add a poll function which can create sets of handles that can be polled together efficiently.
poll_oneoff
itself never fails. It may be interrupted, and there may be
errors on the I/O resources referred to by the handles passed to it, but
the poll isn't doing any I/O of its own, so it has no need to fail.
[This section is not required if you already covered considered alternatives in the design discussion above.]
[Describe an alternative which was considered, and why you decided against it.]
[etc.]
TODO before entering Phase 3.
[This should include a list of implementers who have expressed interest in implementing the proposal]
Many thanks for valuable feedback and advice from:
- [Person 1]
- [Person 2]
- [etc.]