Are some promise functions guaranteed to complete synchronously? #260
-
The specification for functions like However, the example in the repo assumes the call will complete synchronously and have written the result by the time the function returns. I have also seen other tutorials assert that "in practice it will be synchronous". Is this a guarantee for the future? Or is it simply a shortcut taken by the C example to keep it simple for now? (Also, is this where these questions go? I couldn't even find where webgpu-headers comes from spec wise, the W3C spec makes no mention of the native header format) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Good question! As I have understood it, the callback will eventually run asynchronous, but the event-loop mechanism has not been fleshed out yet. In wgpu-py we also assume it runs synchronous for the time being: |
Beta Was this translation helpful? Give feedback.
Good question! As I have understood it, the callback will eventually run asynchronous, but the event-loop mechanism has not been fleshed out yet.
In wgpu-py we also assume it runs synchronous for the time being:
https://github.com/pygfx/wgpu-py/blob/402961a04299a1518ac0fb7ad3dbb44636679dbb/wgpu/backends/rs.py#L280-L282