Closed DylanRJohnston closed 2 months ago
Does this prevent things from working? I suppose this will have to be a breaking change.
I don't believe so, although it's not entirely clear what code wasm_bindgen
generates in this case. I suspect what happens is the same thing as when you have an async js function without any awaits. It just gets turn into an immediately resolving promise.
When I opened this issue I was encountering some issues with waking up from alarms, but that turned out to be an unrelated problem. So it seems pretty harmless that this API isn't really async.
Although I am curious about what's going on under the hood with the worker runtime that allows this method not to be async on the JS side.
https://github.com/cloudflare/workers-rs/blob/aaf5c672c0830e6637d671b4e70c6251fda0c835/worker-sys/src/types/durable_object/storage.rs#L65-L70
The docs on alarms indicate they're not async https://developers.cloudflare.com/durable-objects/api/alarms/#setalarm.