Closed pchickey closed 1 year ago
Looks good. I'll propose this to the upstream wasi-clocks as well.
And as we discussed offline, the plan here is that in the future there will likely be use cases for multiple clocks, but it should be possible to model this in the component model in the future by having a way to treat a component instance as a resource that one can have handles to.
At this time, we don't have use cases for providing multiple wall clocks or multiple monotonic clocks to the same component. So, according to the principle of following preview 1's design as close as possible, we are changing these interfaces to being provided by ambient functions, rather than methods on a resource.
Also, I fixed a typo bug in
host
where the monotonic clock'sresolution
method was implemented usingnow
instead ofresolution
.