Skip to content

monotonic clock: introduce duration type, split subscribe#7358

Merged
pchickey merged 10 commits into
mainfrom
pch/monotonic-clock-duration
Oct 30, 2023
Merged

monotonic clock: introduce duration type, split subscribe#7358
pchickey merged 10 commits into
mainfrom
pch/monotonic-clock-duration

Conversation

@pchickey
Copy link
Copy Markdown
Contributor

Implement the interface change submitted upstream as WebAssembly/wasi-clocks#53

We are introducing a duration type because it has a distinct meaning
from instant: an instant can only be compared to other instants
from the exact same monotonic-clock, whereas a duration represents
a duration of time which can be compared to any other duration of time.

The duration type is motivated, in part, by a desire to reuse it to
specify durations such as timeouts in other WASI proposals.

Instead of taking a boolean specifying whether the u64 is an absolute or
relative time, subscribe-instant takes an instant type and
subscribe-duration takes a duration type.

Pat Hickey added 3 commits October 24, 2023 17:33
We are introducing a `duration` type because it has a distinct meaning
from `instant`: an `instant` can only be compared to other `instant`s
from the exact same `monotonic-clock`, whereas a `duration` represents
a duration of time which can be compared to any other duration of time.

The `duration` type is motivated, in part, by a desire to reuse it to
specify durations such as timeouts in other WASI proposals.

Instead of taking a boolean specifying whether the u64 is an absolute or
relative time, `subscribe-instant` takes an `instant` type and
`subscribe-duration` takes a `duration` type.
@pchickey pchickey requested a review from a team as a code owner October 25, 2023 00:55
@pchickey pchickey requested review from alexcrichton and removed request for a team October 25, 2023 00:55
@github-actions github-actions Bot added the wasi Issues pertaining to WASI label Oct 25, 2023
Comment thread crates/wasi/src/preview2/host/clocks.rs
@pchickey pchickey requested a review from alexcrichton October 27, 2023 22:24
@pchickey pchickey enabled auto-merge October 30, 2023 21:45
@pchickey pchickey added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit a841785 Oct 30, 2023
@pchickey pchickey deleted the pch/monotonic-clock-duration branch October 30, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasi Issues pertaining to WASI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants