Uh oh!
There was an error while loading. Please reload this page.
Stop collecting disposables if changed token encountered - #66265
Conversation
ghost
commented
Mar 6, 2022
Tagging subscribers to this area: @dotnet/area-extensions-primitives Issue Detailsnull
|
eerhardt
commented
Mar 7, 2022
Thank you for the PR, @mapogolions. Can you add a description to this PR explaining what the situation is that is not behaving correctly today, and why it isn't behaving correctly? |
mapogolions
commented
Mar 7, 2022
Traditional flow:We usually pass a list of tokens that have not yet been changed to the constructor of the composite token. where: Then we register some callback for the composite token. at this moment At the output, we have a construct in which the created composite token has not yet been changed If cancellation is requested for one of these tokens the static OnChange method will be called. What it does:
If cancellation is then requested for the second passed token The OnChange method will no longer be called as all disposables(registrations) have been disposed. Issue flow:We also pass a list of tokens, but one of them has already been changed. where: Then we register some callback for the composite token The static method OnChange will be called at the moment of registration by the line above. It will trigger the OnChange method again. This PIR is trying to remove redundant work - if we know that the composite token has changed, why do we still keep registering a callback for each token in order to be able to change the composite token in the future |
eerhardt
left a comment
There was a problem hiding this comment.
LGTM. Just a couple minor code style changes.
FYI @davidfowl - in case you have any concerns here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…hangeTokenTest.cs Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
…hangeTokenTest.cs Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
mapogolions
commented
Mar 8, 2022
@eerhardt Thanks for review. I am still working on my English. I would appreciate any of your suggestions for renaming local variables, classes, functions. |
eerhardt
commented
Mar 10, 2022
I thought they all looked fine. |
eerhardt
commented
Mar 10, 2022
Test failure was #65791. |
No description provided.