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

Consider adding a general capability, independent of current invocation concepts, to align shutdown handling with standard cancellation APIs. (For example, should CancellationToken support be available in async Main?) #1921

Closed
Tracked by #1891
jonsequitur opened this issue Nov 2, 2022 · 3 comments · Fixed by #2044
Milestone

Comments

@jonsequitur
Copy link
Contributor

No description provided.

@KalleOlaviNiemitalo
Copy link

What was decided about the question in the title of this issue:

should CancellationToken support be available in async Main?

@jonsequitur
Copy link
Contributor Author

Apologies for the absence of a description on this issue. I think the issue might be outside the scope of System.CommandLine but the concept of adding CancellationToken support to Main might be worth a new issue in dotnet/runtime.

@adamsitnik Thoughts on this?

@tmds
Copy link
Member

tmds commented Mar 22, 2023

I always liked the idea of having a CancellationToken for Main. It was something that also came up when we were discussing the PosixSignal API. See dotnet/runtime#50527 (comment) and following comments.

You can implement it yourself using the PosixSignal API.

cc @davidfowl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants