We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ac5cf7 commit 68680dfCopy full SHA for 68680df
src/JsonRpc/ResponseRouter.cs
@@ -101,10 +101,10 @@ public async Task<TResponse> Returning<TResponse>(CancellationToken cancellation
101
var tcs = new TaskCompletionSource<JToken>();
102
_router.Requests.TryAdd(nextId, ( _method, tcs ));
103
104
- cancellationToken.ThrowIfCancellationRequested();
105
-
106
try
107
{
+ cancellationToken.ThrowIfCancellationRequested();
+
108
_router.OutputHandler.Value.Send(
109
new OutgoingRequest
110
@@ -117,6 +117,13 @@ public async Task<TResponse> Returning<TResponse>(CancellationToken cancellation
117
() =>
118
119
if (tcs.Task.IsCompleted) return;
120
121
+ if (cancellationToken.IsCancellationRequested)
122
+ {
123
+ tcs.SetCanceled();
124
+ return;
125
+ }
126
127
_router.CancelRequest(new CancelParams { Id = nextId });
128
}
129
);
0 commit comments