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

Async methods do not support cancellation #299

Open
swiftMessenger opened this issue Nov 4, 2022 · 0 comments
Open

Async methods do not support cancellation #299

swiftMessenger opened this issue Nov 4, 2022 · 0 comments

Comments

@swiftMessenger
Copy link
Contributor

The Certes library makes extensive use of async methods (eg: account registration, order placement and retrieval, authorization retrieval, challenge retrieval, validating challenges, etc...). None of these async methods accept cancellation tokens.

Async methods - particularly those involving network requests - should support cancellation tokens to accomodate scenarios where the calling method needs to terminate execution early (eg: from a system timeout or shutdown request).

This may relatively easily be achieved by adding an overload for async methods to accept a CancellationToken as the final argument (eg: in AcmeContext: public async Task<IAccountContext> Account(CancellationToken cancellationToken = default(CancellationToken))). All async HttpClient operations already support this token so it should mostly be a matter of passing the CancellationToken through to all async methods.

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

1 participant