julia-snail
julia-snail copied to clipboard
Allow interrupting long-running Julia tasks
Right now, a computation kicked off using any of the julia-snail-send-*
commands cannot be interrupted.
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?
Nope, no separate tasks for evaluation. :( I agree that's a good approach.
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.
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.