Closed arnaudh closed 2 months ago
Had a quick look at the code and documentation, seems like @showprogress
can work with asyncmap
, and a quick test shows the issue is not present in that case:
@showprogress asyncmap(1:10) do i
sleep(i*0.1)
end
Output:
Progress: 100%|█████████████████████████████████████████████████████████| Time: 0:00:02
Sounds like this is the way to go.
Note I assumed my example (using ayncmap
and next!
) would be supported because of the note on thread-safety in the README (with the example using @threads
and next!
). Might be worth mentioning that asyncmap
is only supported via @showprogress
.
The problem appears when two parallel tasks try to erase and write at the same time
Using next!
with a ParallelProgress
will be possible with #157
this should now work by forcing the lock (Progress(10; safe_lock=true)
) (#322)
Output:
Seems like the line doesn't get properly cleared/overriden when multiple calls to
next!(progress)
happen concurrently.Note if I bump the sleep to a higher value (
sleep(i)
), the issue goes away: