Codebase list golang-github-vbauerster-mpb / 60616af
refactoring ShutdownListener interface Vladimir Bauer 3 years ago
2 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
643643 for i := 0; i < len(s.shutdownListeners); i++ {
644644 switch d := s.shutdownListeners[i]; i {
645645 case len(s.shutdownListeners) - 1:
646 d.Shutdown()
646 d.OnShutdown()
647647 default:
648648 wg.Add(1)
649649 go func() {
650 d.Shutdown()
650 d.OnShutdown()
651651 wg.Done()
652652 }()
653653 }
112112 // If decorator needs to be notified once upon bar shutdown event, so
113113 // this is the right interface to implement.
114114 type ShutdownListener interface {
115 Shutdown()
115 OnShutdown()
116116 }
117117
118118 // Global convenience instances of WC with sync width bit set.