Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for RegisterWatch (0.4 sec)

  1. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go

    // of watches in the system for the purpose of estimating the
    // cost of incoming mutating requests.
    type WatchTracker interface {
    	// RegisterWatch reqisters a watch based on the provided http.Request
    	// in the tracker. It returns the function that should be called
    	// to forget the watcher once it is finished.
    	RegisterWatch(r *http.Request) ForgetWatchFunc
    
    	// GetInterestedWatchCount returns the number of watches that are
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  2. pkg/kube/krt/internal.go

    )
    
    // 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) {
    		for _, o := range events {
    			f(o)
    		}
    	}, true)
    }
    
    // castEvent converts an Event[I] to Event[O].
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. pkg/kube/krt/join.go

    }
    
    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 {
    		sync.syncers = append(sync.syncers, c.RegisterBatch(f, runExistingState))
    	}
    	return sync
    }
    
    // nolint: unused // (not true, its to implement an interface)
    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/static.go

    }
    
    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 {
    	if runExistingState {
    		f(slices.Map(s.List(), func(e T) Event[T] {
    			return Event[T]{
    				New:   &e,
    				Event: controllers.EventAdd,
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  5. pkg/kube/krt/core.go

    	Synced() Syncer
    
    	// RegisterBatch registers a handler that accepts multiple events at once. This can be useful as an optimization.
    	// Otherwise, behaves the same as Register.
    	// Additionally, skipping the default behavior of "send all current state through the handler" can be turned off.
    	// This is important when we register in a handler itself, which would cause duplicative events.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  6. pkg/kube/krt/fetch.go

    		// rerunning the same collection's recomputation at the same time (once for the initial event, then for the initial registration).
    		c.RegisterBatch(ff, false)
    	})
    
    	// Now we can do the real fetching
    	// Compute our list of all possible objects that can match. Then we will filter them later.
    	// This pre-filtering upfront avoids extra work
    	var list []T
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  7. pkg/kube/krt/singleton.go

    	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 {
    			f([]Event[T]{{
    				New:   v,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  8. pkg/kube/krt/informer.go

    		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)
Back to top