Codebase list golang-github-vbauerster-mpb / 0510122
refactoring: interceptIO Vladimir Bauer 3 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2525 uwg *sync.WaitGroup
2626 bwg *sync.WaitGroup
2727 operateState chan func(*pState)
28 interceptIo chan func(io.Writer)
28 interceptIO chan func(io.Writer)
2929 done chan struct{}
3030 shutdown chan struct{}
3131 cancel func()
8686 uwg: s.uwg,
8787 bwg: new(sync.WaitGroup),
8888 operateState: make(chan func(*pState)),
89 interceptIo: make(chan func(io.Writer)),
89 interceptIO: make(chan func(io.Writer)),
9090 done: make(chan struct{}),
9191 shutdown: make(chan struct{}),
9292 cancel: cancel,
182182 }
183183 ch := make(chan *result)
184184 select {
185 case p.interceptIo <- func(w io.Writer) {
185 case p.interceptIO <- func(w io.Writer) {
186186 n, err := w.Write(b)
187187 ch <- &result{n, err}
188188 }:
253253 select {
254254 case op := <-p.operateState:
255255 op(s)
256 case fn := <-p.interceptIo:
256 case fn := <-p.interceptIO:
257257 fn(cw)
258258 case <-tickerC:
259259 e := render()