Skip to content

Commit

Permalink
WithShutdownNotifier: chan<- interface{}
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Feb 11, 2023
1 parent 93889df commit 4c2e771
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions container_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,11 @@ func WithRenderDelay(ch <-chan struct{}) ContainerOption {
}
}

// WithShutdownNotifier provided chanel will be closed, after all bars
// have been rendered.
func WithShutdownNotifier(ch chan struct{}) ContainerOption {
// WithShutdownNotifier value of type `[]*mpb.Bar` will be send into provided
// channel upon container shutdown.
func WithShutdownNotifier(ch chan<- interface{}) ContainerOption {
return func(s *pState) {
select {
case <-ch:
default:
s.shutdownNotifier = ch
}
s.shutdownNotifier = ch
}
}

Expand Down

0 comments on commit 4c2e771

Please sign in to comment.