You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to hold onto a promise such that I can create new children, without blocking cancellation propagation from any existing children. With such a mechanism, I should have a callback that's invoked as soon as all children have requested cancel, so I can throw away the parent promise I'm holding.
The idea here is so I can dedupe requests for an upstream asynchronous resource (such as loading images from the network), and allow for cancelling the upstream asynchronous resource as soon as all children have declared they're no longer interested in it.
The text was updated successfully, but these errors were encountered:
The actual implementation here is basically just returning a pre-sealed promise, but we need to do this as a child so we have access to the onRequestCancel callback as being able to drop the promise at the point where cancellation is propagated from children upwards is important.
Or we could actually just seal the receiver and attach a new onCancelRequested callback to the resolver. I'm not terribly fond of this because that will pipe cancellation upwards prior to calling the new callback, which means we could end up in a situation where our new onCancelRequested callback is invoked after an onCancel callback (if cancellation is handled upstream as .immediate and onCancel is also .immediate).
I want to be able to hold onto a promise such that I can create new children, without blocking cancellation propagation from any existing children. With such a mechanism, I should have a callback that's invoked as soon as all children have requested cancel, so I can throw away the parent promise I'm holding.
The idea here is so I can dedupe requests for an upstream asynchronous resource (such as loading images from the network), and allow for cancelling the upstream asynchronous resource as soon as all children have declared they're no longer interested in it.
The text was updated successfully, but these errors were encountered: