News for hackers. Stuff that matters.
Re:Async Cancellation by dangerbird2 on Friday November 12, 2021 @09:32AM (#29199583)
Javascript does have finalizers now[1], which is a much-needed feature for webassembly interop where you need to explicitly call destructors to clean up any wasm data the object owns. However, this wouldn't help with promises where you need cleanup code to be called deterministically, not whenever the GC gets around to cleaning up the object. As you mention, using cancellation tokens that raise an exception is a reasonable solution

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

There are no comments on this comment yet.