-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Pass CancellationToken to WaitAsync in client #20210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -601,7 +601,7 @@ async Task OnStreamCanceled(InvocationRequest irq) | |||
var readers = default(Dictionary<string, object>); | |||
|
|||
CheckDisposed(); | |||
var connectionState = await _state.WaitForActiveConnectionAsync(nameof(StreamAsChannelCoreAsync)); | |||
var connectionState = await _state.WaitForActiveConnectionAsync(nameof(StreamAsChannelCoreAsync), token: cancellationToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove token = default
from all of our internal methods that wait for the semaphore like WaitForActiveConnectionAsync, SendWithLock, WaitConnectionLockAsync, etc...?
I know WaitConnectionLockAsync in particular has a lot of usages where we don't want to use a cancellation token for close/reconnect logic, but I like being explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Be aware, branching is underway. I think we can still get this in to preview3 but likely have to retarget. |
/azp run |
Switched base and re-running pipeline |
Azure Pipelines successfully started running 2 pipeline(s). |
@dotnet/aspnet-build @Pilchie are we OK to merge to preview3? We'd really like to get this in to preview3 if we can (it's not essential but would be nice to not have to wait a month ;)). |
Go for it. |
Fixes #12882