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
The existence of an onCancel handler prevents automatic cancellation propagation from other children from cancelling the upstream parent. An onCancel handler should always act like a tap, as it's rather surprising that registering to be notified when a promise is cancelled would prevent the promise from being cancelled.
The text was updated successfully, but these errors were encountered:
This one is complicated because making it behave like tap means ignoring cancellation requests, except we need requestCancel() to continue working as promise.then(…).catch(…).onCancel(…) should have the same behavior as promise.always(…).
Currently, any promise that propagates cancellation also prevents its parent from being automatically cancelled if the child hasn't been cancelled. What we want for onCancel is a way to tell the parent that it should cancel if it goes out of scope and it has no children that propagate cancellation.
We could possibly do this by having the cancellation request increment the upstream promise's observer count prior to propagating the cancel. This way the upstream promise is then marked as having had observers if it hadn't already.
The existence of an
onCancel
handler prevents automatic cancellation propagation from other children from cancelling the upstream parent. AnonCancel
handler should always act like a tap, as it's rather surprising that registering to be notified when a promise is cancelled would prevent the promise from being cancelled.The text was updated successfully, but these errors were encountered: