Conversation
|
Are you backporting this to |
|
@WyriHaximus I haven't planned that. I think you're asking for reactphp/http#213. If a version of react/promise is supported which doesn't have this patch, then cancellation propagation must be manually implemented, like here: https://github.com/reactphp/http/pull/213/files#diff-45da203c5746d523d3d75762c539b707R56 I took care to be backward compatible, so that a canceller registered with a follower takes precedence over the canceller from the parent promise: https://github.com/reactphp/promise/pull/99/files#diff-71f7b9a6df57aaf364b33eacad82e245R116 |
clue
left a comment
There was a problem hiding this comment.
Good catch, change LGTM! 👍
Shouldn't this be filed against current master and then be backported for the v2 branch? Either way, I'm good with this ![]()
|
@clue I'm not sure tbh what's common practice here. I've done that always by starting a patch for the latest released version and then porting down to older and/or up to unreleased versions. |
Revert follower cancellation propagation (#99)
|
For reference only: This PR has been reverted via #122 for this release and is planned for a future release instead. |
This PR implements cancellation propagation for promises following another promise in the same way currently implemented for child promises created by
then().Consider the following code:
The behaviour is identical regarding resolution. Both
$childand$followerfollow$rootwhich means, both will be fulfilled or rejected in the same way as$root.The behaviour is different regarding cancellation though.
$child->cancel()is called,$rootis cancelled although$followeris still interested in the result.$follower->cancel()is called, cancellation is not propagated to$root.This PR fixes that, so
$followerpropagates cancellation in the same way as$child.