Closed loganek closed 8 months ago
On an exotic platform with no underlying clock, it's ok to have a wasi-clocks that always returns the same time evern time (as if the computer is just really fast :wink:). If the user subscribes to a timeout, the clock could just immediately update its time to the timeout value and notify the timeout immediately.
But yes, it is infallible, because that simplifies using it in most scenarios, as clocks effectively don't fail dynamically.
Yeah, agree the clock shouldn't fail at runtime, the question was more about lack of the functionality. I guess returning constant is a good workaround for me.
Thanks for the quick reply.
Do apologize if that was already discussed, but couldn't find it. How should the runtime report an error in case it can't handle the call? e.g. wall clock might not be supported on some of the exotic platforms, but they might have access to a monotonic clock. How should the platform communicate the lack of one of the clocks? In preview1 the function could return an error, but in preview2 I see the return value from the
now()
function is just anuint64
, not aResult
type.Thanks