julia-snail icon indicating copy to clipboard operation
julia-snail copied to clipboard

Allow interrupting long-running Julia tasks

Open gcv opened this issue 2 years ago • 4 comments

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

gcv avatar Jul 27 '22 04:07 gcv

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?

MasonProtter avatar May 30 '23 19:05 MasonProtter

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

gcv avatar May 31 '23 04:05 gcv

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.

MasonProtter avatar Jun 02 '23 20:06 MasonProtter

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 avatar Aug 04 '23 20:08 gcv