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

Add cancellation suport to async methods #38

Closed
supermihi opened this issue Dec 27, 2021 · 3 comments · Fixed by #39
Closed

Add cancellation suport to async methods #38

supermihi opened this issue Dec 27, 2021 · 3 comments · Fixed by #39

Comments

@supermihi
Copy link

Hi,
first of all thank you for this very well written library! One thing I noticed is that none of the async methods seem to accept an (optional) CancellationToken, contrary to the usual .NET practice (and the underlying methods such as HttpClient.SendAsync do support cancellation).
Is this an explicit design decision or did just nobody dare to add the parameters yet?

@Zastai
Copy link
Owner

Zastai commented Dec 27, 2021

It was no real design decision other than avoiding even more parameters and/or overloads. Plus, no one asked for it, probably because no one was using the library asynchronously.

As I mentioned in a comment on #37, I am now working on adding such tokens everywhere (usually as sn optional argument, which does break binary compatibility).

@Zastai
Copy link
Owner

Zastai commented Dec 27, 2021

Once #37 is merged, I will prepare a branch (and PR) for these changes.

@supermihi
Copy link
Author

Oops sorry, I overlooked that comment. I agree that optional arguments are preferable, that also seems to be the standard in system libraries.

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

Successfully merging a pull request may close this issue.

2 participants