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

Allow CancellationToken in Execute method #612

Closed
sean-mcl opened this issue Mar 23, 2021 · 1 comment
Closed

Allow CancellationToken in Execute method #612

sean-mcl opened this issue Mar 23, 2021 · 1 comment

Comments

@sean-mcl
Copy link

Hello,

I am currently trying to modify the scripts at runtime. If the script changes, the current execution of the script should be aborted. Is this somehow possible in .NET 5.0?

I would like to have the ability to pass a CancellationToken to the Execute task.

Thanks for the cool library! 👍🏻

@filipw
Copy link
Member

filipw commented Apr 19, 2021

I can add cancellation, but it will not really work as you expect it.
In general aborting a script is not really possible (see the discussion here in the C# compiler repo dotnet/roslyn#23145 (comment))

The best you could do would be to run the script as an external process and kill that process when you know "it's time" to do it.

@filipw filipw closed this as completed May 5, 2021
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

2 participants