Open
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
/Cancelled
2 and use it for this too.