gaukas / watm

WebAssembly Transport Module
GNU General Public License v3.0
1 stars 0 forks source link

⭐ feat: add `poll_oneoff`-based poll #3

Closed gaukas closed 7 months ago

gaukas commented 7 months ago

As previously discussed in #1 and goal set in #2, this pull request introduces an exciting function: _poll, which has a Unix-like interface and calls to poll_oneoff to block on a few fd:event tuples until at least one of them is triggered OR the timeout has passed.

While poll_oneoff supports no timeout natively, it still supports clock event and that's how we implemented timeout.

We will need to patch our wazero fork for a better poll_oneoff for sure. Currently, our fork will not correctly support the timeout and will block on fd indefinitely.

gaukas commented 7 months ago

@erikziyunchi Would it be possible for us to nudge this PR a bit? I have some pending changes (e.g., utls.wasm) which would be based on this PR.