Closed AshlinHarris closed 1 year ago
Currently, this doesn't work in Julia 1.9 on Linux. The process remains with the status ProcessSignaled(15)
and isn't terminated.
I finally hacked together something that updates a spinner while calculations are done and closes the process (by sending a character to its stdin
):
command = "t=Threads.@async read(stdin, Char);while !istaskdone(t);for q=['\\\\','|','/','-'];print(q);sleep(0.1);print('\b')end;end;exit()"
proc_input = Pipe()
proc = run(pipeline(`julia -e $command`, stdin = proc_input, stdout = stdout, stderr = stderr), wait = false)
sum(map(i->BigInt(999)^10_000_000 % i, 1:10)); # Do some calculations
write(proc_input,'c') #Signal the spinner process to stop
Now I can update the source and push v0.4.
I'll adapt the spinners from Spinners.jl (Oct. 5, 2022).
The following seems to be working on Windows now:
It might be feasible to abandon multithreading and parallel in favor of just shelling out with a new julia process. This would also work for Julia v1.2 and up, rather than relying on experimental features.