convert newProxyReader to func
Vladimir Bauer
3 years ago
| 94 | 94 |
result := make(chan bool)
|
| 95 | 95 |
select {
|
| 96 | 96 |
case b.operateState <- func(s *bState) { result <- len(s.ewmaDecorators) != 0 }:
|
| 97 | |
return b.newProxyReader(r, <-result)
|
|
97 |
return newProxyReader(r, b, <-result)
|
| 98 | 98 |
case <-b.done:
|
| 99 | 99 |
return nil
|
| 100 | 100 |
}
|
| 51 | 51 |
return n, err
|
| 52 | 52 |
}
|
| 53 | 53 |
|
| 54 | |
func (b *Bar) newProxyReader(r io.Reader, hasEwma bool) io.ReadCloser {
|
|
54 |
func newProxyReader(r io.Reader, b *Bar, hasEwma bool) io.ReadCloser {
|
| 55 | 55 |
return toReadCloser(toReader(r, b, hasEwma))
|
| 56 | 56 |
}
|
| 57 | 57 |
|