-
-
Notifications
You must be signed in to change notification settings - Fork 261
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 Async Methods on CommandLineApplication that accept CancellationToken #153
Comments
In addition, async methods don't support passing in a cancellation token. |
Somewhat related: #111. This is new API I would consider adding in 3.0 which I plan to start work on later this year. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 7 days. |
Stale bot closed this, but I'm interested in adding this in 3.0. Reopening. |
Describe the bug
Consider the following code snippet:
The API doesn't expose
ExecuteAsync(args, cancellationToken)
.To Reproduce
There is no ExecuteAsync method that takes a cancellation token, which in turn complicates matters when
TCommand
implements an ExecuteAsync method, which uses a cancellation token.Expected behavior
The expectation is that all methods on
CommandLineApplication
exposes async methods that accepts a cancellation token, so that a long running application can be cancelled.Additional context
The need exists to signal to the instance of
TCommand
that is running asynchronously that processing should be cancelled for whatever reason, e.g. the user pressed CTRL+C.The text was updated successfully, but these errors were encountered: