From 91781afd6e3071fbbece86392ef077739eabeee9 Mon Sep 17 00:00:00 2001
From: Yosh A poll API intended to let users wait for I/O events on multiple handles
at once. Return the readiness of a pollable. This function never blocks. Returns This function is equivalent to calling 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.
-
-
wasi:io/poll@0.2.0
wasi:clocks/monotonic-clock@0.2.0
wasi:clocks/wall-clock@0.2.0
wasi:io/poll@0.2.0
wasi:clocks/monotonic-clock@0.2.0
wasi:clocks/wall-clock@0.2.0
Import interface wasi:io/poll@0.2.0
+Import interface wasi:io/poll@0.2.0
Types
-
+resource pollable
resource pollable
pollable
represents a single I/O event which may be ready, or not.Functions
-
+[method]pollable.ready: func
[method]pollable.ready: func
true
when the pollable is ready, and false
otherwise.Params
Return values
-
+[method]pollable.block: func
[method]pollable.block: func
block
returns immediately if the pollable is ready, and otherwise
blocks until ready.poll.poll
on a list
containing only this pollable.Params
-
+poll: func
poll: func
WASI Monotonic Clock is a clock API intended to let users measure elapsed time.
It is intended to be portable at least between Unix-family platforms and Windows.
A monotonic clock is a clock which has an unspecified initial value, and successive reads of the clock will produce non-decreasing values.
-It is intended for measuring elapsed time.
type pollable
type pollable
-#### `type instant` +#### `type instant` `u64`
An instant in time, in nanoseconds. An instant is relative to an unspecified initial value, and can only be compared to instances from the same monotonic-clock. -
type duration
type duration
u64
A duration of time, in nanoseconds.
now: func
now: func
Read the current value of the clock.
The clock is monotonic, therefore calling this function repeatedly will produce a sequence of non-decreasing values.
@@ -89,36 +88,36 @@ produce a sequence of non-decreasing values. -resolution: func
resolution: func
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
subscribe-instant: func
subscribe-instant: func
Create a pollable
which will resolve once the specified instant
has occurred.
pollable
>subscribe-duration: func
subscribe-duration: func
Create a pollable
that will resolve after the specified duration has
elapsed from the time this function is invoked.
pollable
>WASI Wall Clock is a clock API intended to let users query the current time. The name "wall" makes an analogy to a "clock on the wall", which is not necessarily monotonic as it may be reset.
@@ -131,16 +130,16 @@ monotonic, making it unsuitable for measuring elapsed time.It is intended for reporting the current date and time for humans.
record datetime
record datetime
A time and date in seconds plus nanoseconds.
seconds
: u64
nanoseconds
: u32
seconds
: u64
nanoseconds
: u32
now: func
now: func
Read the current value of the clock.
This clock is not monotonic, therefore calling this function repeatedly will not necessarily produce a sequence of non-decreasing values.
@@ -152,7 +151,7 @@ also known as Unix Time. -resolution: func
resolution: func
Query the resolution of the clock.
The nanoseconds field of the output is always less than 1000000000.