Skip to content
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

[Question] Cancelling a request #1186

Open
georgy93 opened this issue Jun 3, 2021 · 1 comment
Open

[Question] Cancelling a request #1186

georgy93 opened this issue Jun 3, 2021 · 1 comment

Comments

@georgy93
Copy link

georgy93 commented Jun 3, 2021

Hello!

I want to know how the request cancellation works in Refit
If I have the following configuration with global cancellation

ConfigureHttpClient(client =>
                {
                    client.Timeout = TimeSpan.FromSeconds(3);
                })

And I call a method on a Refit Client with local cancellation token, which cancels after 5 seconds, then which cancellation token will be used?
Are the global and local getting merged in a linked token source or one of them is taken with priority (which one)?

@clairernovotny
Copy link
Member

I'm not sure how the timeout works in HttpClient itself. We pass the CancellationToken from any parameters into all methods that accept one. You'd need to see how HttpClient handles that combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants