forked from WebAssembly/wasi-sockets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert `tcp-socket`, `udp-socket`, `network`, and `resolve-address-stream` to resources. This also updates the dependencies to account for the changes in WebAssembly/wasi-io#46.
- Loading branch information
1 parent
2534b91
commit 68a519b
Showing
14 changed files
with
1,273 additions
and
1,211 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,9 +1,4 @@ | ||
[io] | ||
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz" | ||
sha256 = "eeb4701c2becafa40a7ee3bf0d2c94e2170e15806b25abdcd1de1ed94f2c1036" | ||
sha512 = "89be853b2acae211570cd6ad0ec9d8132881dafbdea83ac7b4cad600f0627003c61f310427379bf47ecf862724367bd5d6e976db70069f6f90a3c2d9c20dbfb7" | ||
|
||
[poll] | ||
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz" | ||
sha256 = "9f8bb4d9994e9b0684859bb1e8bee2a8b873e04d40695f260446760fc44d0c58" | ||
sha512 = "aa8da395ba6e189ec113296996da5abf28bdc4460e4eb2aacc786698ced892e08f7054fb590fc8809c05554d5c83a11494d4ab68c755746f57d151e212415cfb" | ||
url = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz" | ||
sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d" | ||
sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9" |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz" | ||
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz" | ||
# Temporarily use the resources branches. | ||
#io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz" | ||
io = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz" |
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,34 @@ | ||
package wasi:io | ||
|
||
/// A poll API intended to let users wait for I/O events on multiple handles | ||
/// at once. | ||
interface poll { | ||
/// A "pollable" handle. | ||
resource pollable | ||
|
||
/// Poll for completion on a set of pollables. | ||
/// | ||
/// This function takes a list of pollables, which identify I/O sources of | ||
/// interest, and waits until one or more of the events is ready for I/O. | ||
/// | ||
/// The result `list<u32>` contains one or more indices of handles in the | ||
/// argument list that is ready for I/O. | ||
/// | ||
/// If the list contains more elements than can be indexed with a `u32` | ||
/// value, this function traps. | ||
/// | ||
/// A timeout can be implemented by adding a pollable from the | ||
/// wasi-clocks API to the list. | ||
/// | ||
/// This function does not return a `result`; polling in itself does not | ||
/// do any I/O so it doesn't fail. If any of the I/O sources identified by | ||
/// the pollables has an error, it is indicated by marking the source as | ||
/// being reaedy for I/O. | ||
poll-list: func(in: list<borrow<pollable>>) -> list<u32> | ||
|
||
/// Poll for completion on a single pollable. | ||
/// | ||
/// This function is similar to `poll-list`, but operates on only a single | ||
/// pollable. When it returns, the handle is ready for I/O. | ||
poll-one: func(in: borrow<pollable>) | ||
} |
Oops, something went wrong.