File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -110,18 +110,7 @@ func (cs *ChannelSource) Start(
110
110
111
111
cs .once .Do (func () {
112
112
// Distribute GenericEvents to all EventHandler / Queue pairs Watching this source
113
- go func () {
114
- for {
115
- select {
116
- case <- cs .stop :
117
- // Close destination channels
118
- cs .doStop ()
119
- return
120
- case evt := <- cs .Source :
121
- cs .distribute (evt )
122
- }
123
- }
124
- }()
113
+ go cs .syncLoop ()
125
114
})
126
115
127
116
dst := make (chan event.GenericEvent , cs .DestBufferSize )
@@ -172,6 +161,19 @@ func (cs *ChannelSource) distribute(evt event.GenericEvent) {
172
161
}
173
162
}
174
163
164
+ func (cs * ChannelSource ) syncLoop () {
165
+ for {
166
+ select {
167
+ case <- cs .stop :
168
+ // Close destination channels
169
+ cs .doStop ()
170
+ return
171
+ case evt := <- cs .Source :
172
+ cs .distribute (evt )
173
+ }
174
+ }
175
+ }
176
+
175
177
// KindSource is used to provide a source of events originating inside the cluster from Watches (eh.g. Pod Create)
176
178
type KindSource struct {
177
179
// Type is the type of object to watch. e.g. &v1.Pod{}
You can’t perform that action at this time.
0 commit comments