Expose Shutdown func for EventBroadcaster

Kubernetes-commit: 57d43e4946f352f075b219b0a2f35942b06cfeb9
This commit is contained in:
Ted Yu
2019-10-07 08:58:38 -07:00
committed by Kubernetes Publisher
parent 911ef75fbc
commit c4ea3eed4f
3 changed files with 14 additions and 0 deletions

View File

@@ -102,6 +102,10 @@ func newBroadcaster(sink EventSink, sleepDuration time.Duration, eventCache map[
}
}
func (e *eventBroadcasterImpl) Shutdown() {
e.Broadcaster.Shutdown()
}
// refreshExistingEventSeries refresh events TTL
func (e *eventBroadcasterImpl) refreshExistingEventSeries() {
// TODO: Investigate whether lock contention won't be a problem

View File

@@ -54,6 +54,9 @@ type EventBroadcaster interface {
// NOTE: events received on your eventHandler should be copied before being used.
// TODO: figure out if this can be removed.
StartEventWatcher(eventHandler func(event runtime.Object)) func()
// Shutdown shuts down the broadcaster
Shutdown()
}
// EventSink knows how to store events (client-go implements it.)