-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add WasiCtxBuilder
setters for the two clock types
#6669
Conversation
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Could this perhaps remove the |
We should drop the WasiClocks intermediate struct entirely and just have two members of WasiCtx for the wall and monotonic clock - would you be willing to do that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thank you. One last suggestion if you're up to it - in the past I used the convention WasiThing
to name the host types, but as we shifted to the component model, I've preferred HostThing
instead - would you mind renaming these HostMonotonicClock
and HostWallClock
?
Also I'm not sure if the +Send+Sync in each box is required since those traits already require send and sync, maybe those could have been removed a while ago...
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@pchickey I've renamed the traits. Unfortunately, the compiler seems to require the
|
@rylev The PR here is good, but separately, I'm curious; would you mind saying a little more about what your use case looks like? I'm interested in learning about who's using non-default clocks and what they're using them for. |
@sunfishcode unfortunately it's not too interesting - just doing some testing around ABI conformance of wasm binaries built with old versions of wit-bindgen that have been adapted to run against the latest version of wasmtime. You can see the code here. |
This allows users to set individual clock types on the
WasiCtxBuilder
.Before
After
I didn't add any documentation because most of the other setters don't have any, and I was unsure what form the documentation should take.