Provide CancellationToken as optional parameter to all methods, so requests can be cancelled or timed-out.
See original GitHub issueIt is common for APIs involving potentially long http requests, to accept a CancellationToken
, such that a call can be cancelled, or timed-out by a user.
It would be fairly simple to add to this API, as it would be just need be passed down to the HttpClient
, that accepts one in SendAsync
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Recommended patterns for CancellationToken
It's a good idea to only make your CancellationToken parameters optional in your public API (if you have one) and leave them as...
Read more >c# - Default parameter for CancellationToken
Semantically, CancellationToken.None would be the ideal candidate for the default, but cannot be used as such because it isn't a compile-time ...
Read more >CA1068: CancellationToken parameters must come last
Method has one or more optional parameters (Optional in Visual Basic) following a non-optional cancellation token parameter.
Read more >A Deep Dive into C#'s CancellationToken | by Mitesh Shah
Here we start cancellable tasks and pass the cancellation token to the delegate that's running. Passing to the task here is optional. User ......
Read more >A .NET Programmer's Guide to CancellationToken
NET Core 2.0, actions support an optional CancellationToken parameter that may signal if an HTTP request has been closed, allowing cancellation of any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright, I can take a stab at this, standby
Published in 5.1.0 🚀