We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When cancelling SendQueryAsync with a CancellationToken, there will be no immediate TaskCancelledException thrown
I'm using this workaround right now:
private static Task<GraphQLResponse> SendQueryAsyncX(this GraphQLHttpClient client, GraphQLRequest request, CancellationToken ct) { TaskCompletionSource<GraphQLResponse> tcs = new TaskCompletionSource<GraphQLResponse>(); ct.Register(() => tcs.TrySetCanceled()); client.SendQueryAsync(request, ct).ContinueWith(result => { if (result.IsFaulted) { tcs.TrySetException(result.Exception); } else if (result.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(result.Result); } }, TaskScheduler.FromCurrentSynchronizationContext()); return tcs.Task; }
When a CancellationToken is cancelled, the Task should complete without any time lag to allow responsiveness out of the box.
The text was updated successfully, but these errors were encountered:
which version of the library are you using?
Sorry, something went wrong.
create tests to cover request cancellation ( #140)
049ed1a
No branches or pull requests
When cancelling SendQueryAsync with a CancellationToken, there will be no immediate TaskCancelledException thrown
I'm using this workaround right now:
When a CancellationToken is cancelled, the Task should complete without any time lag to allow responsiveness out of the box.
The text was updated successfully, but these errors were encountered: