progressbar
progressbar copied to clipboard
Add support for child ProgressBar
Initial implementation. Build on top of https://github.com/ctongfei/progressbar/pull/69

Fixes #66
Wow! Thanks @vehovsky !!! This change would merit the 1.0 release I think. I'll review and release asap.
I think that this proposal need more discussion. There are two cases with parent/children progress bars:
- The parent
msteps, and for each step there isnsteps (there could be sub-progressbars spawning and dying in the process). - The parent finishes if all its children finishes (the parent does not have its own progress)
I think what you implemented here is the second case.
Yes it is initial implementation only.
Well the actual progress of the parent is calculated as average of all it children/subchildren/etc. progresses.
It is true the "max" of parent is only size of immediate children, not subchildren/etc.
So instead:
max = children.size();
Something like:
int getSize(List<ProgressState> children) {
AtomicInteger result = new AtomicInteger(children.size());
if (children.size() > 0) {
children.forEach(state -> result.addAndGet(getSize(state.children)));
}
return result.get();
}
Yes and I think that we need to discuss to understand the subtle semantics of the two cases. In the meantime, I'm thinking of releasing an interim 0.9 version with your fabulous multi-line contribution, and leave this for a later 1.0.
Yes and I think that we need to discuss to understand the subtle semantics of the two cases. In the meantime, I'm thinking of releasing an interim
0.9version with your fabulous multi-line contribution, and leave this for a later1.0.
@ctongfei Can you release 0.9?
@nadilas 0.9.0 was relased https://github.com/ctongfei/progressbar/blob/master/CHANGELOG.md
I am a bit worried about the conflicts here. Maybe @vehovsky can fix them? 😇
Hey,
don't mean to be annoying, but is there any ETA on when this can be released?
@nadilas 0.9.0 was relased https://github.com/ctongfei/progressbar/blob/master/CHANGELOG.md
I am a bit worried about the conflicts here. Maybe @vehovsky can fix them? 😇
Let's try this again 😅 @koppor How can we help?
It would be great if better multiline support could be added for 0.9.
And I would also like to add another scenario to this, or clarify if it is already covered by this.
The parent m steps, and for each step there is n steps (there could be sub-progressbars spawning and dying in the process).
My scenario would be similar, e.g. parent has m steps (files) and can process up to n files in parallel, i.e. it would show up to n child progress bars. The child progress bars would depend on the individual files and can have a different number of steps. Once a files is processed, the thread would pickup another file and process it, either reusing a child progress bar or creating a new one - whatever is the correct strategy.
@leonard84 Seems someone needs to redo this PR - and @vehovsky seems to be inactive. Anyone volunteering for the sake of hacktoberfest?