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

ExtendedTasks: how to kill a task? #4093

Open
mauromiguelm opened this issue Jul 3, 2024 · 2 comments
Open

ExtendedTasks: how to kill a task? #4093

mauromiguelm opened this issue Jul 3, 2024 · 2 comments

Comments

@mauromiguelm
Copy link

Thanks ExtendedTasks implementation, it has a promissing future!

As of shiny 1.8.1.1, the methods available for ExtendedTasks are:

     • ‘ExtendedTask$new()’

     • ‘ExtendedTask$invoke()’

     • ‘ExtendedTask$status()’

     • ‘ExtendedTask$result()’

It would be quite useful to have a ExtendedTask$Kill() method that would kill the respective process associated with the task. Such method would better handle cases of expensive tasks where user decides to change inputs half-way. Such actions would create multiple processes running expensive tasks, which is something we want to avoid.

Concept:

ExtendedTask$kill() # kill all previous task
ExtendedTask$invoke() #start a new task based on new input
@ismirsehregal
Copy link
Contributor

ismirsehregal commented Jul 3, 2024

Please check @jcheng5's answer here.

@nirguk
Copy link

nirguk commented Aug 9, 2024

Based on jcheng5's example solution; I've made a further gist to demonstrate how with R6 subclassing, we can make the $kill() though (I called it $stop_m in my example, for a Mirai backed extendedTask)
link

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

3 participants