Is it possible to gracefully kill a joblib process (threading backend), and still return the so far computed results ?
parallel = Parallel(n_jobs=4, backend="threading")
result = parallel(delayed(dummy_f)(x) for x in range(100))
For the moment I came up with two solutions
parallel._aborted = True
which waits for the started jobs to finish (in my case it can be very long)parallel._terminate_backend()
which hangs if jobs are still in the pipe (parallel._jobs
not empty)
Is there a way to workaround the lib to do this ?