pchickey opened PR #7427 from bytecodealliance:pch/pollable_methods
to bytecodealliance:main
:
Downstreaming changes to wasi:io/poll proposed here:
https://github.com/WebAssembly/wasi-io/pull/54poll-list becomes poll and poll-one becomes a method directly on pollable - these are NFCs, just renamings for ergonomics, and because poll-one was easily confused with poll-oneoff.
pollable.ready is new functionality that allows you to check the readiness of a pollable without blocking. I took the most trivial path to implement it via futures::poll_immediate. I had to add a minor optimization to the clock deadline future so that we can test it by asserting
subscribe_duration(0).ready()
andsubscribe_instant(now() - 1).ready()
are true.
pchickey requested alexcrichton for a review on PR #7427.
pchickey requested wasmtime-core-reviewers for a review on PR #7427.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this perhaps be
matches!(..., Some(()))
to emphasize this isn't accidentally throwing away a "real" result from the poll?
alexcrichton created PR review comment:
Ideally this method wouldn't be on this list since it shouldn't block, but I can also see how that complicates the implementation, so I'm fine either way
pchickey updated PR #7427.
pchickey submitted PR review.
pchickey created PR review comment:
Good idea!
pchickey submitted PR review.
pchickey created PR review comment:
Agreed. The implementation, as it stands, shouldn't ever actually be Pending, and I think we will be able to keep an eye on that invariant going forwards.
pchickey has enabled auto merge for PR #7427.
pchickey merged PR #7427.
Last updated: Nov 22 2024 at 16:03 UTC