dispatchrun / wasi-go

A Go implementation of the WebAssembly System Interface (WASI)
Apache License 2.0
124 stars 7 forks source link

make poll_oneoff resilient to invalid subscriptions #8

Closed achille-roussel closed 1 year ago

achille-roussel commented 1 year ago

This PR addresses a few TODO in the poll_oneoff implementation to be more resilient to invalid configurations.

I also modified the signature of PollOneOff to take the input and output buffers as arguments and return the number of events written to the output buffer instead of doing an append (same model as the default WASI); I did this to be able to correlate the indexes of subscriptions and events, which was helpful to support assigning errors to events.