-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify poll with empty list #67
Clarify poll with empty list #67
Comments
That is a really good question! My preference is to treat an empty list of pollables as an illegal input, specify that case will trap. Hanging indefinitely doesn't do any favors for either implementors or users. Compared to trapping, I'm less in favor of returning immediately, because that doesn't seem to meet the spirit of blocking until at least one pollable is ready, and so it allows users to keep the invariant that at least one element is returned. |
This issue should still be open for #69 to be merged. |
The spec doesn't explicitly mention what should happen when
poll
is called with an empty list. Should it return immediately, block forever, or trap? With the current specification I can see people interpreting it either way. I certainly did.I tried Googling for what native platforms do. On Windows, WSAPoll requires there to be at least one item. Linux and FreeBSD don't mention it in their documentation. Even StackOverflow etc don't have any useful info on this. So it appears that this is a pretty obscure edge case, which makes me think trapping might be the "best" option.
The current Wasmtime implementation hangs indefinitely.
The text was updated successfully, but these errors were encountered: