Skip to content

Commit

Permalink
chore: update to latest wasi:io WIT (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
  • Loading branch information
rvolosatovs committed Oct 16, 2023
1 parent d61ace2 commit 7ba8ae5
Show file tree
Hide file tree
Showing 8 changed files with 293 additions and 259 deletions.
2 changes: 1 addition & 1 deletion wit/caching.wit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Time-to-Live values (within the usual limitations around time in a
// distributed setting).
interface cache {
use wasi:poll/poll.{pollable}
use wasi:io/poll.{pollable}
use types.{key, incoming-value, outgoing-value, error}

// The `get` operation returns the value passed by a previous `set` for the
Expand Down
9 changes: 2 additions & 7 deletions wit/deps.lock
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 = "6e18239b0e20d1a3e6343cb961ebfd2c663ba7feb4c1aa3744b756fbdd1fb5b8"
sha512 = "53169b6e4fba0b2cf5fcf808f76e7fbb7cabb6ed66ab53f77d0966e7448312ccbe8571880ef4fc2ee86fbd6ba19bc48d46e10d22dcac6c51d217e8d7127c32db"

[poll]
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
sha256 = "d4c27124f4c137eb538b5c92ba5858ed9042e11b24a2eef85d14becd0b7f55de"
sha512 = "422c01b273b4b1377ece6f2e4ba0dfc609ca8ef30a3e0be0e172e1303fcf7b3ca4c470f4dea6c51bdf114b0f5c871ebc4934dfe3bf217d66ea689748df2b1e55"
sha256 = "a00c29dd57dc224e8ce28b793b19c1b1001dcdbdc229ed451c3df1db91841b34"
sha512 = "8558085eeb5689209101cdfbc9782953d559ad14ce77260fe2f7cc472482d568f65cad9e6a688d40c634c6c54c608f27e27e481633446114d6fdead93d4e34c5"
1 change: 0 additions & 1 deletion wit/deps.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
34 changes: 34 additions & 0 deletions wit/deps/io/poll.wit
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>);
}
Loading

0 comments on commit 7ba8ae5

Please sign in to comment.