roelvandijk / terminal-progress-bar

Other
24 stars 9 forks source link

Joining the thread spawned by startProgress #10

Closed andersjel closed 7 years ago

andersjel commented 9 years ago

At the moment, it is hard to know when the thread spawned by startProgress is done printing. This makes it difficult to put a newline after the last line and do any additional output. Right now, one has to introduce an artificial delay or live with the race condition.

roelvandijk commented 7 years ago

Good point. It would be nice if we could solve this without needing an ugly hack like an artificial delay.

I'll have to think a bit more about the asynchronous interface.

roelvandijk commented 7 years ago

Implemented in 828817f8a567d86a380ff277f94a6d8390cd4d7a. I used the async package which provides a good interface for this use case.