Codebase list golang-github-vbauerster-mpb / debb108
godoc comments Vladimir Bauer 4 years ago
1 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
154154 }
155155 }
156156
157 // EnableTriggerComplete enables triggering complete event by increment
158 // methods or triggers it now if bar already has been incremented up
159 // to the total. Triggering complete event is auto disabled if bar
160 // constructed with `total <= 0`.
157 // EnableTriggerComplete enables triggering complete event. It's
158 // effective only for bar which was constructed with `total <= 0`.
159 // If bar has been incremented to the total, complete event is
160 // triggered right away.
161161 func (b *Bar) EnableTriggerComplete() {
162162 select {
163163 case b.operateState <- func(s *bState) {
176176 }
177177 }
178178
179 // SetTotal sets total to an arbitrary value. Setting it to negative
180 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool). If
181 // triggerCompleteNow is true, current value is set to total and
182 // complete event is triggered right away.
179 // SetTotal sets total to an arbitrary value. It's effective only for
180 // bar which was constructed with `total <= 0`. Setting total to negative
181 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool).
182 // If triggerCompleteNow is true then total value is set to current
183 // and complete event is triggered right away.
183184 func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
184185 select {
185186 case b.operateState <- func(s *bState) {