Codebase list golang-github-vbauerster-mpb / 487eca1
non blocking SetRefill Vladimir Bauer 5 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
131131 // Given default bar style is "[=>-]<+", refill rune is '+'.
132132 // To set bar style use mpb.BarStyle(string) BarOption.
133133 func (b *Bar) SetRefill(amount int64) {
134 b.operateState <- func(s *bState) {
134 select {
135 case b.operateState <- func(s *bState) {
135136 s.refill = amount
137 }:
138 case <-b.done:
136139 }
137140 }
138141