-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
wasi-io: Reimplement wasi-io/poll using a Pollable trait #7812
Open
badeend
wants to merge
29
commits into
bytecodealliance:main
Choose a base branch
from
badeend:pollable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+560
−200
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6b4d634
Remove `+ Sync` constraints from preview2 implementation
badeend a2de6ec
Only use mutable references in WasiView to guarantee unique access to…
badeend 1e766c2
Always use Descriptor::Directory for directories, regardless of wheth…
badeend 75ce698
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
badeend 942769e
Remove some more `+ Sync`s
badeend 0b839b5
Remove one more
badeend 16eaf07
typo
badeend 562f83d
Fix build errors on Rust <= 1.73. Code already compiled fine on >= 1.74
badeend 3ac45de
ResourceTable take+restore
badeend b376c31
Rename Pollable -> PollableResource
badeend fda1966
Reimplement wasi-io/poll. This introduces a new Pollable trait which …
badeend fcc3e87
Remove ResourceTable::iter_entries. It was used only by the old `poll…
badeend d9a9842
Eliminate the (now) unnecessary surrogate parent resource of clock po…
badeend 537b3f6
Forbid empty poll list.
badeend 59e379f
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
badeend cf3d161
Test for specific error
badeend 6a713a8
Simplify ready() and pending()
badeend f0f5209
Typo
badeend d6905b6
Replace panics with errors
badeend 53349a8
Remove Lease and SlotIdentity types.
badeend 8d54bd3
Add take_any & restore_any variants
badeend f7d8c4c
Redesign Pollable interface to not drop read() Futures in between pol…
badeend 96b79f0
Rename Subscribe -> PollableAsync. Because Pollable and PollableAsync…
badeend bd67f42
PollableResource -> PollableHandle
badeend 3692f9d
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
badeend 45ce638
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
badeend 2130c43
Rename Pollable -> PollableInternal, PollableAsync -> Subscribe, Poll…
badeend 6e12a8a
Make the internals actually internal.
badeend 742987b
Update docs
badeend File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use test_programs::wasi::cli::stdin; | ||
|
||
fn main() { | ||
let stdin = stdin::get_stdin(); | ||
let p1 = stdin.subscribe(); | ||
let p2 = stdin.subscribe(); | ||
|
||
// Should work: | ||
// - Exactly the same pollable passed in multiple times. | ||
// - Distinct pollables for the same backing resource (stdin in this case). | ||
test_programs::wasi::io::poll::poll(&[&p1, &p2, &p1, &p2]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() { | ||
// Polling an empty list should trap: | ||
test_programs::wasi::io::poll::poll(&[]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we need this change in the wits, lets just be sure to upstream these to the spec repo as well. We will come up with some process for how we keep the docs evolving and improving while assuring that the interface itself doesn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebAssembly/wasi-io#69