question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide CancellationToken as optional parameter to all methods, so requests can be cancelled or timed-out.

See original GitHub issue

It 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pianomanjhcommented, Mar 6, 2020

Alright, I can take a stab at this, standby

0reactions
nozzlegearcommented, Apr 20, 2020

Published in 5.1.0 🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found