Codebase list golang-github-vbauerster-mpb / c073120
b.flushed in parallel Vladimir Bauer 9 years ago
1 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
101101 func (p *progress) server() {
102102 t := time.NewTicker(refreshRate * time.Millisecond)
103103 bars := make([]*Bar, 0, 4)
104 lw := uilive.New()
105 lw.Out = p.out
104 lw := uilive.New(p.out)
106105 for {
107106 select {
108107 case op, ok := <-p.op:
131130 }
132131 case <-t.C:
133132 for _, b := range bars {
134 fmt.Fprintln(lw, b.String())
133 // cannot parallel this, because order matters
134 fmt.Fprintln(lw, b)
135135 }
136136 lw.Flush()
137137 for _, b := range bars {
138 b.flushed()
138 go func(b *Bar) {
139 b.flushed()
140 }(b)
139141 }
140142 case d := <-p.interval:
141143 t.Stop()