File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func main() {
4848 job := "installing"
4949 // preparing delayed bars
5050 b := p .AddBar (rand .Int63n (101 )+ 100 ,
51- mpb .BarReplaceOnComplete (bars [i ]),
51+ mpb .BarParkTo (bars [i ]),
5252 mpb .BarClearOnComplete (),
5353 mpb .PrependDecorators (
5454 decor .Name (task , decor.WC {W : len (task ) + 1 , C : decor .DidentRight }),
Original file line number Diff line number Diff line change @@ -61,10 +61,17 @@ func BarRemoveOnComplete() BarOption {
6161 }
6262}
6363
64- // BarReplaceOnComplete is indicator for delayed bar start, after the
65- // `runningBar` is complete. To achieve bar replacement effect,
66- // `runningBar` should has its `BarRemoveOnComplete` option set.
64+ // BarReplaceOnComplete is deprecated. Refer to BarParkTo option.
6765func BarReplaceOnComplete (runningBar * Bar ) BarOption {
66+ return BarParkTo (runningBar )
67+ }
68+
69+ // BarParkTo parks constructed bar into the runningBar. In other words,
70+ // constructed bar will start only after runningBar has been completed.
71+ // Parked bar will replace runningBar if BarRemoveOnComplete option
72+ // is set on the runningBar. Parked bar inherits priority of the
73+ // runningBar, if no BarPriority option is set.
74+ func BarParkTo (runningBar * Bar ) BarOption {
6875 return func (s * bState ) {
6976 s .runningBar = runningBar
7077 }
You can’t perform that action at this time.
0 commit comments