pchickey opened PR #7358 from bytecodealliance:pch/monotonic-clock-duration
to bytecodealliance:main
:
Implement the interface change submitted upstream as https://github.com/WebAssembly/wasi-clocks/pull/53
We are introducing a
duration
type because it has a distinct meaning
frominstant
: aninstant
can only be compared to otherinstant
s
from the exact samemonotonic-clock
, whereas aduration
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 aninstant
type and
subscribe-duration
takes aduration
type.
pchickey requested alexcrichton for a review on PR #7358.
pchickey requested wasmtime-core-reviewers for a review on PR #7358.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this method perhaps delegate to
subscribe_duration
or a similar helper once it calculates the relative desiredDuration
? Or alternatively would it be possible to directly convert betweenwhen
and atokio::time::Instant
?It basically felt a bit odf that the
Never
case was handled below but not here
pchickey updated PR #7358.
pchickey submitted PR review.
pchickey created PR review comment:
Thanks, I thought that over again and factored it out into a helper function.
pchickey requested alexcrichton for a review on PR #7358.
pchickey updated PR #7358.
alexcrichton submitted PR review.
pchickey updated PR #7358.
pchickey has enabled auto merge for PR #7358.
pchickey merged PR #7358.
Last updated: Nov 22 2024 at 17:03 UTC