Codebase list golang-github-vbauerster-mpb / d2dbdb3
lastFrame Vladimir Bauer 9 years ago
2 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1616 tip byte
1717 leftEnd byte
1818 rightEnd byte
19
20 lastFrame []byte
1921
2022 incrCh chan int
2123 redrawReqCh chan chan []byte
161163 b.redrawReqCh <- respCh
162164 return string(<-respCh)
163165 }
164 return ""
166 return string(b.lastFrame)
165167 }
166168
167169 func (b *Bar) server(wg *sync.WaitGroup) {
206208 respCh <- int(100 * float64(current) / float64(b.total))
207209 case <-b.flushedCh:
208210 if completed && !b.isDone() {
211 stat := &Statistics{b.total, current, timeElapsed, tpie}
212 b.lastFrame = b.draw(stat, buf, appendFuncs, prependFuncs)
209213 close(b.done)
210214 wg.Done()
215 return
211216 }
212217 case <-b.stopCh:
213218 close(b.done)
136136 cw = cwriter.New(w)
137137 case op, ok := <-p.op:
138138 if !ok {
139 for _, b := range bars {
140 b.Stop()
141 }
142139 t.Stop()
143140 return
144141 }