Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monotonic clock: introduce duration type, split subscribe #7358

Merged
merged 10 commits into from
Oct 30, 2023

Conversation

pchickey
Copy link
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
@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