-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Labels
asyncAsynchronous operations and callbacksAsynchronous operations and callbacksnon-breakingDoes not require a breaking change (that would block V1.0)Does not require a breaking change (that would block V1.0)
Description
Futures can currently be cancelled only by dropping the instance. It would be useful to be able cancel them individually.
As an example, if you write a C++ RAII wrapper around a WGPUFuture (say, myapp::WebGPUFuture<wgpu::ComputePipeline>) and you drop it, there's no way to ensure the callback gets called except to wait for the future. If we had a way to cancel futures like void wgpuInstanceCancelFuture(WGPUFuture)1, you could do that instead - basically, call the callback immediately and ignore/abort any ongoing work.
Right now we already have the InstanceDropped status, I think we could genericize this to Canceled/Cancelled2 and use it for this too.
Footnotes
Metadata
Metadata
Assignees
Labels
asyncAsynchronous operations and callbacksAsynchronous operations and callbacksnon-breakingDoes not require a breaking change (that would block V1.0)Does not require a breaking change (that would block V1.0)