lastFrame
Vladimir Bauer
9 years ago
| 16 | 16 | tip byte |
| 17 | 17 | leftEnd byte |
| 18 | 18 | rightEnd byte |
| 19 | ||
| 20 | lastFrame []byte | |
| 19 | 21 | |
| 20 | 22 | incrCh chan int |
| 21 | 23 | redrawReqCh chan chan []byte |
| 161 | 163 | b.redrawReqCh <- respCh |
| 162 | 164 | return string(<-respCh) |
| 163 | 165 | } |
| 164 | return "" | |
| 166 | return string(b.lastFrame) | |
| 165 | 167 | } |
| 166 | 168 | |
| 167 | 169 | func (b *Bar) server(wg *sync.WaitGroup) { |
| 206 | 208 | respCh <- int(100 * float64(current) / float64(b.total)) |
| 207 | 209 | case <-b.flushedCh: |
| 208 | 210 | if completed && !b.isDone() { |
| 211 | stat := &Statistics{b.total, current, timeElapsed, tpie} | |
| 212 | b.lastFrame = b.draw(stat, buf, appendFuncs, prependFuncs) | |
| 209 | 213 | close(b.done) |
| 210 | 214 | wg.Done() |
| 215 | return | |
| 211 | 216 | } |
| 212 | 217 | case <-b.stopCh: |
| 213 | 218 | close(b.done) |