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
If we double-box the Promise, we can track when any given Promise is no longer capable of having new observers attached or its result property ready. At this point, if all attached observers have cancelled, we can go ahead and cancel the parent promise.
With this scheme we can remove .linkCancel entirely as it will just happen automatically. It's slightly less flexible, as I cannot create a second observer on a promise without affecting cancellation behavior, but it's worth it for the simplified API.
Note: If a new Promise becomes unobservable without having any observers attached to begin with, we will not automatically cancel it. This behavior would be surprising, in the event that the promise has observable side-effects.
The text was updated successfully, but these errors were encountered:
When bridging between Swift↔Obj-C we should just behave like .linkCancel (which is what we do today). We can't do normal cancel propagation because the Swift bridging code can't see Obj-C private stuff. But that's ok because the bridged promise is supposed to be a stand-in for the original promise, which means cancelling the bridged promise should go ahead and immediate cancel the original promise even if there are other observers attached to it.
If we double-box the Promise, we can track when any given Promise is no longer capable of having new observers attached or its
result
property ready. At this point, if all attached observers have cancelled, we can go ahead and cancel the parent promise.With this scheme we can remove
.linkCancel
entirely as it will just happen automatically. It's slightly less flexible, as I cannot create a second observer on a promise without affecting cancellation behavior, but it's worth it for the simplified API.Note: If a new
Promise
becomes unobservable without having any observers attached to begin with, we will not automatically cancel it. This behavior would be surprising, in the event that the promise has observable side-effects.The text was updated successfully, but these errors were encountered: