From 5614600f62178a87eaba2cb27724c0cb34f6994a Mon Sep 17 00:00:00 2001 From: Jiaxiao Zhou Date: Wed, 13 Sep 2023 11:19:35 -0700 Subject: [PATCH] rename example-world to imports world (#49) * rename example-world to imports world Signed-off-by: Jiaxiao Zhou (Mossaka) * chore: update wit deps Signed-off-by: Jiaxiao Zhou (Mossaka) --------- Signed-off-by: Jiaxiao Zhou (Mossaka) --- wit/deps.lock | 4 ++-- wit/deps/poll/poll.wit | 24 +++++++++++++++++------- wit/world.wit | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/wit/deps.lock b/wit/deps.lock index 9d2f1d0..6babe9f 100644 --- a/wit/deps.lock +++ b/wit/deps.lock @@ -1,4 +1,4 @@ [poll] url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz" -sha256 = "9f8bb4d9994e9b0684859bb1e8bee2a8b873e04d40695f260446760fc44d0c58" -sha512 = "aa8da395ba6e189ec113296996da5abf28bdc4460e4eb2aacc786698ced892e08f7054fb590fc8809c05554d5c83a11494d4ab68c755746f57d151e212415cfb" +sha256 = "d4c27124f4c137eb538b5c92ba5858ed9042e11b24a2eef85d14becd0b7f55de" +sha512 = "422c01b273b4b1377ece6f2e4ba0dfc609ca8ef30a3e0be0e172e1303fcf7b3ca4c470f4dea6c51bdf114b0f5c871ebc4934dfe3bf217d66ea689748df2b1e55" diff --git a/wit/deps/poll/poll.wit b/wit/deps/poll/poll.wit index 55eee00..fa82b60 100644 --- a/wit/deps/poll/poll.wit +++ b/wit/deps/poll/poll.wit @@ -23,17 +23,27 @@ interface poll { /// 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` is the same length as the argument + /// `list`, and indicates the readiness of each corresponding + /// element in that list, with true indicating ready. A single call can + /// return multiple true elements. + /// + /// 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 + /// ready in the `list`. + /// /// The "oneoff" in the name refers to the fact that this function must do a /// linear scan through the entire list of subscriptions, which may be /// inefficient if the number is large and the same subscriptions are used /// many times. In the future, this is expected to be obsoleted by the /// component model async proposal, which will include a scalable waiting /// facility. - /// - /// Note that the return type would ideally be `list`, but that would - /// be more difficult to polyfill given the current state of `wit-bindgen`. - /// See - /// for details. For now, we use zero to mean "not ready" and non-zero to - /// mean "ready". - poll-oneoff: func(in: list) -> list + poll-oneoff: func(in: list) -> list } diff --git a/wit/world.wit b/wit/world.wit index 291a9c7..5c2dd41 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,6 +1,6 @@ package wasi:clocks -world example-world { +world imports { import monotonic-clock import wall-clock import timezone