wasi-io
wasi-io copied to clipboard
poll_list timeouts
Was it ever discussed to support direct timeout args to poll_list?
Typically to avoid possibly blocking on a long-running task when there are no immediate tasks, one has to create a short timeout, then add that to the list for each call to poll_list, resulting in an extra host call per iteration.
The intended way to do this is to request a pollable from wasi:clocks/monotonic-clock, such as subscribe-instant or subscribe_duration, and add that to the list passed to poll_list.
Ah, to answer your question, no, we haven't looked at adding a timeout directly to poll_list. But if there are use cases where the extra host call per iteration is significant, I think we'd be open to considering adding a form of poll_list with a timeout.