Codebase list golang-github-vbauerster-mpb / 4c2e771
WithShutdownNotifier: chan<- interface{} Vladimir Bauer 3 years ago
1 changed file(s) with 4 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
5555 }
5656 }
5757
58 // WithShutdownNotifier provided chanel will be closed, after all bars
59 // have been rendered.
60 func WithShutdownNotifier(ch chan struct{}) ContainerOption {
58 // WithShutdownNotifier value of type `[]*mpb.Bar` will be send into provided
59 // channel upon container shutdown.
60 func WithShutdownNotifier(ch chan<- interface{}) ContainerOption {
6161 return func(s *pState) {
62 select {
63 case <-ch:
64 default:
65 s.shutdownNotifier = ch
66 }
62 s.shutdownNotifier = ch
6763 }
6864 }
6965