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 interrupting long-running Julia tasks #104

Closed
gcv opened this issue Jul 27, 2022 · 4 comments
Closed

Allow interrupting long-running Julia tasks #104

gcv opened this issue Jul 27, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@gcv
Copy link
Owner

gcv commented Jul 27, 2022

Right now, a computation kicked off using any of the julia-snail-send-* commands cannot be interrupted.

@gcv gcv added the enhancement New feature or request label Jul 27, 2022
@MasonProtter
Copy link
Contributor

I think the solution to this is just having an interrupt function which does Base.throwto(julia_snail_task, InterruptException()). Does julia-snail already have a separate task it uses for evaluation?

@gcv
Copy link
Owner Author

gcv commented May 31, 2023

Nope, no separate tasks for evaluation. :( I agree that's a good approach.

@MasonProtter
Copy link
Contributor

MasonProtter commented Jun 2, 2023

Probably what you should do is launch the computation in a task, and then have another task that checks every n miliseconds if the task is completed, and if it is completed you fetch it.

You can then stick a hook into that secondary task that does the interruption when requested.

@gcv
Copy link
Owner Author

gcv commented Aug 4, 2023

This is fixed in a88755d. Or so I hope! Snail now runs evaluations sent on its wire protocol in separate Julia tasks, and they're tracked and interruptible using M-x julia-snail-interrupt-task. The change will be in MELPA in a couple of hours. Feedback and bug reports welcome.

@gcv gcv closed this as completed Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants