Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for RegisterWatch (0.44 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. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker_test.go

    				t.Fatalf("unexpected error from requestInfo creation: %#v", err)
    			}
    			ctx := request.WithRequestInfo(context.Background(), requestInfo)
    			r := testCase.request.WithContext(ctx)
    
    			forget := watchTracker.RegisterWatch(r)
    			if testCase.expected == nil {
    				if forget != nil {
    					t.Errorf("unexpected watch registered: %#v", watchTracker.watchCount)
    				}
    				return
    			}
    
    			if forget == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 03 14:02:51 UTC 2021
    - 10.4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go

    			}()
    			noteExecutingDelta(1)
    			defer noteExecutingDelta(-1)
    			served = true
    			setResponseHeaders(classification, w)
    
    			forgetWatch = h.fcIfc.RegisterWatch(r)
    
    			// Notify the main thread that we're ready to start the watch.
    			close(shouldStartWatchCh)
    
    			// Wait until the request is finished from the APF point of view
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:35 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go

    	// AllPolicies includes peer-authentication converted policies
    	AuthorizationPolicies, AllPolicies := PolicyCollections(AuthzPolicies, PeerAuths, MeshConfig, Waypoints, Pods)
    	AllPolicies.RegisterBatch(PushXds(a.XDSUpdater, func(i model.WorkloadAuthorization) model.ConfigKey {
    		return model.ConfigKey{Kind: kind.AuthorizationPolicy, Name: i.Authorization.Name, Namespace: i.Authorization.Namespace}
    	}), false)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 19 17:19:41 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  10. pkg/kube/krt/collection.go

    		// When we run RegisterBatch, it will trigger events for the initial state. However, other events could trigger
    		// while we are processing these.
    		// By holding the lock, we ensure we have exclusive access during this time.
    		h.recomputeMu.Lock()
    		h.eventHandlers.MarkInitialized()
    		handlerReg := c.RegisterBatch(func(events []Event[I], initialSync bool) {
    			if log.DebugEnabled() {
    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