-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
Description
I am creating multiple progress bars, each one as a task in a thread pool (up to 300). When. the thread pool is running more than one task at once, the progress bars all end up on the same line.
I checked an Terminal.cursorMovementSupported is set to true.
The code looks like this:
executorService.submit(() -> {
try (CliProgressMonitor progressMonitor = new CliProgressMonitor(message, terminalWidth.get())) {
// do long running task
}
});
private static final class CliProgressMonitor extends BatchingProgressMonitor implements AutoCloseable {
private final ProgressBar progressBar;
public CliProgressMonitor(String message, int terminalWidth) {
this.progressBar = new ProgressBarBuilder()
.setStyle(ProgressBarStyle.UNICODE_BLOCK)
.setTaskName(message)
.setMaxRenderedLength(terminalWidth)
.hideETA()
.build();
}
...
}Is there anything wrong with the approach, should the closing of the progressbar be changed or sth?
Thanks for your help!
Reactions are currently unavailable