- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 358 for limiter (0.24 sec)
-
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup.go
// when the wait group is in waiting mode. func (wg *RateLimitedSafeWaitGroup) Done() { var limiter RateLimiter func() { wg.mu.Lock() defer wg.mu.Unlock() wg.count -= 1 if wg.wait { // we are using the limiter outside the scope of the lock limiter = wg.limiter } }() defer wg.wg.Done() if limiter != nil { limiter.Wait(wg.stopCtx) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Feb 21 14:08:00 UTC 2023 - 3.7K bytes - Viewed (0) -
pkg/kubelet/apis/grpc/ratelimit.go
func LimiterUnaryServerInterceptor(limiter Limiter) grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if !limiter.Allow() { return nil, ErrorLimitExceeded } return handler(ctx, req) } } // WithRateLimiter creates new rate limiter with unary interceptor.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 09 07:22:23 UTC 2023 - 1.9K bytes - Viewed (0) -
pkg/controller/nodelifecycle/scheduler/rate_limited_queue.go
// the expected next time of execution. It is also rate limited. type RateLimitedTimedQueue struct { queue UniqueQueue limiterLock sync.Mutex limiter flowcontrol.RateLimiter } // NewRateLimitedTimedQueue creates new queue which will use given // RateLimiter to oversee execution. func NewRateLimitedTimedQueue(limiter flowcontrol.RateLimiter) *RateLimitedTimedQueue { return &RateLimitedTimedQueue{
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Mar 07 07:50:01 UTC 2023 - 8.2K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup_test.go
func TestRateLimitedSafeWaitGroup(t *testing.T) { // we want to keep track of how many times rate limiter Wait method is // being invoked, both before and after the wait group is in waiting mode. limiter := &limiterWrapper{} // we expect the context passed by the factory to be used var cancelInvoked int factory := &factory{ limiter: limiter, grace: 2 * time.Second, ctx: context.Background(), cancel: func() {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Feb 21 14:08:00 UTC 2023 - 8.6K bytes - Viewed (0) -
src/internal/types/testdata/check/slices.go
r = append(r, v) } } return r } // Example uses func limiter(x int) byte { switch { case x < 0: return 0 default: return byte(x) case x > 255: return 255 } } var input = []int{-4, 68954, 7, 44, 0, -555, 6945} var limited1 = Map[int, byte](input, limiter) var limited2 = Map(input, limiter) // using type inference func reducer(x float64, y int) float64 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 17 19:54:25 UTC 2023 - 1.5K bytes - Viewed (0) -
fastapi/concurrency.py
# since we're creating a new limiter for each call, any non-zero limit # works (1 is arbitrary) exit_limiter = CapacityLimiter(1) try: yield await run_in_threadpool(cm.__enter__) except Exception as e: ok = bool( await anyio.to_thread.run_sync( cm.__exit__, type(e), e, None, limiter=exit_limiter ) )
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Mon Dec 25 17:57:35 UTC 2023 - 1.4K bytes - Viewed (0) -
pkg/controller/podautoscaler/rate_limiters.go
return 1 } // Forget indicates that an item is finished being retried. func (r *FixedItemIntervalRateLimiter) Forget(item string) { } // NewDefaultHPARateLimiter creates a rate limiter which limits overall (as per the // default controller rate limiter), as well as per the resync interval func NewDefaultHPARateLimiter(interval time.Duration) workqueue.TypedRateLimiter[string] { return NewFixedItemIntervalRateLimiter(interval)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 04 18:33:12 UTC 2024 - 1.8K bytes - Viewed (0) -
pkg/kubelet/images/helpers.go
kubecontainer.ImageService limiter flowcontrol.RateLimiter } func (ts throttledImageService) PullImage(ctx context.Context, image kubecontainer.ImageSpec, secrets []v1.Secret, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, error) { if ts.limiter.TryAccept() { return ts.ImageService.PullImage(ctx, image, secrets, podSandboxConfig) } return "", fmt.Errorf("pull QPS exceeded")
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Nov 05 13:02:13 UTC 2022 - 1.6K bytes - Viewed (0) -
pkg/controlplane/controller/legacytokentracking/controller.go
// rate limiter controls the rate limit of the creation of the configmap. // this is useful in multi-apiserver cluster to prevent config existing in a // cluster with mixed enabled/disabled controllers. otherwise, those // apiservers will fight to create/delete until all apiservers are enabled // or disabled. creationRatelimiter *rate.Limiter clock clock.Clock }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 04 18:33:12 UTC 2024 - 6K bytes - Viewed (0) -
src/runtime/timestub.go
// but widely used packages access it using linkname. // Notable members of the hall of shame include: // - gitee.com/quant1x/gox // - github.com/phuslu/log // - github.com/sethvargo/go-limiter // - github.com/ulule/limiter/v3 // // Do not remove or change the type signature. // See go.dev/issue/67401. // //go:linkname time_now time.now func time_now() (sec int64, nsec int32, mono int64) { sec, nsec = walltime()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 16:25:21 UTC 2024 - 889 bytes - Viewed (0)