func (c *MonitorController) Run(threadiness int, stopCh chan struct{}) {
	defer runtime.HandleCrash()

	// Let the workers stop when we are done
	defer c.queue.ShutDown()
	log.Println("Starting Ingress Monitor controller")

	go c.informer.Run(stopCh)

	// Wait for all involved caches to be synced, before processing items from the queue is started
	if !cache.WaitForCacheSync(stopCh, c.informer.HasSynced) {
		runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
		return
	}

	for i := 0; i < threadiness; i++ {
		go wait.Until(c.runWorker, time.Second, stopCh)
	}

	<-stopCh
	log.Println("Stopping Ingress Monitor controller")
}
// Run method starts the controller
Run method starts the controller
// Run method starts the controller
func (c *MonitorController) Run(threadiness int, stopCh chan struct{}) {
	defer runtime.HandleCrash()
	defer c.queue.ShutDown()
	log.Println("Starting Ingress Monitor controller")
	go c.informer.Run(stopCh)
	if !cache.WaitForCacheSync(stopCh, c.informer.HasSynced) {
		runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
		return
	}
	for i := 0; i < threadiness; i++ {
		go wait.Until(c.runWorker, time.Second, stopCh)
	}
	<-stopCh
	log.Println("Stopping Ingress Monitor controller")
}
func ( c * MonitorController ) Run ( threadiness int , stopCh chan struct { } ) { defer runtime . HandleCrash ( ) defer c . queue . ShutDown ( ) log . Println ( " " ) go c . informer . Run ( stopCh ) if ! cache . WaitForCacheSync ( stopCh , c . informer . HasSynced ) { runtime . HandleError ( fmt . Errorf ( " " ) ) return } for i := 0 ; i < threadiness ; i ++ { go wait . Until ( c . runWorker , time . Second , stopCh ) } <- stopCh log . Println ( " " ) }
Run method starts the controller
Run method starts the controller
// Let the workers stop when we are done // Wait for all involved caches to be synced, before processing items from the queue is started