Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for registerHandlerAsBatched (0.38 sec)

  1. pkg/kube/krt/internal.go

    	"istio.io/api/type/v1beta1"
    	"istio.io/istio/pkg/config"
    	"istio.io/istio/pkg/kube/controllers"
    	"istio.io/istio/pkg/ptr"
    )
    
    // registerHandlerAsBatched is a helper to register the provided handler as a batched handler. This allows collections to
    // only implement RegisterBatch.
    func registerHandlerAsBatched[T any](c internalCollection[T], f func(o Event[T])) Syncer {
    	return c.RegisterBatch(func(events []Event[T], initialSync bool) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  2. pkg/kube/krt/static.go

    func (s *staticList[T]) augment(a any) any {
    	return a
    }
    
    func (s *staticList[T]) List() []T {
    	return maps.Values(s.vals)
    }
    
    func (s *staticList[T]) Register(f func(o Event[T])) Syncer {
    	return registerHandlerAsBatched(s, f)
    }
    
    func (s *staticList[T]) Synced() Syncer {
    	return alwaysSynced{}
    }
    
    func (s *staticList[T]) RegisterBatch(f func(o []Event[T], initialSync bool), runExistingState bool) Syncer {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. pkg/kube/krt/join.go

    				res = append(res, i)
    			}
    		}
    	}
    	return res
    }
    
    func (j *join[T]) Register(f func(o Event[T])) Syncer {
    	return registerHandlerAsBatched[T](j, f)
    }
    
    func (j *join[T]) RegisterBatch(f func(o []Event[T], initialSync bool), runExistingState bool) Syncer {
    	sync := multiSyncer{}
    	for _, c := range j.collections {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  4. pkg/kube/krt/singleton.go

    }
    
    func (d *static[T]) List() []T {
    	v := d.val.Load()
    	if v == nil {
    		return nil
    	}
    	return []T{*v}
    }
    
    func (d *static[T]) Register(f func(o Event[T])) Syncer {
    	return registerHandlerAsBatched[T](d, f)
    }
    
    func (d *static[T]) RegisterBatch(f func(o []Event[T], initialSync bool), runExistingState bool) Syncer {
    	d.eventHandlers.Insert(f)
    	if runExistingState {
    		v := d.val.Load()
    		if v != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  5. pkg/kube/krt/informer.go

    	if got := i.inf.Get(string(k), ""); !controllers.IsNil(got) {
    		return &got
    	}
    	return nil
    }
    
    func (i *informer[I]) Register(f func(o Event[I])) Syncer {
    	return registerHandlerAsBatched[I](i, f)
    }
    
    func (i *informer[I]) RegisterBatch(f func(o []Event[I], initialSync bool), runExistingState bool) Syncer {
    	// Note: runExistingState is NOT respected here.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 10 11:01:46 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. pkg/kube/krt/collection.go

    	h.mu.Lock()
    	defer h.mu.Unlock()
    	return maps.Values(h.collectionState.outputs)
    }
    
    func (h *manyCollection[I, O]) Register(f func(o Event[O])) Syncer {
    	return registerHandlerAsBatched[O](h, f)
    }
    
    func (h *manyCollection[I, O]) RegisterBatch(f func(o []Event[O], initialSync bool), runExistingState bool) Syncer {
    	if runExistingState {
    		h.recomputeMu.Lock()
    		defer h.recomputeMu.Unlock()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 19.4K bytes
    - Viewed (0)
Back to top