Codebase list golang-github-vbauerster-mpb / d345b72
refactoring renderDelay to dealyRC Vladimir Bauer 3 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
5050 // rendering will start as soon as provided chan is closed.
5151 func WithRenderDelay(ch <-chan struct{}) ContainerOption {
5252 return func(s *pState) {
53 s.renderDelay = ch
53 s.delayRC = ch
5454 }
5555 }
5656
4444 reqWidth int
4545 popCompleted bool
4646 autoRefresh bool
47 renderDelay <-chan struct{}
47 delayRC <-chan struct{}
4848 manualRC <-chan interface{}
4949 shutdownNotifier chan<- interface{}
5050 queueBars map[*Bar]*Bar
273273 }
274274
275275 func (s pState) autoRefreshListener(done chan struct{}) {
276 if s.renderDelay != nil {
277 <-s.renderDelay
276 if s.delayRC != nil {
277 <-s.delayRC
278278 }
279279 ticker := time.NewTicker(s.refreshRate)
280280 defer ticker.Stop()