Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,614 for limiter (0.14 sec)

  1. 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)
  2. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        RateLimiter limiter = RateLimiter.create(Double.POSITIVE_INFINITY, stopwatch);
        limiter.acquire(Integer.MAX_VALUE / 4);
        limiter.acquire(Integer.MAX_VALUE / 2);
        limiter.acquire(Integer.MAX_VALUE);
        assertEvents("R0.00", "R0.00", "R0.00"); // no wait, infinite rate!
    
        limiter.setRate(2.0);
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 21.6K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        RateLimiter limiter = RateLimiter.create(Double.POSITIVE_INFINITY, stopwatch);
        limiter.acquire(Integer.MAX_VALUE / 4);
        limiter.acquire(Integer.MAX_VALUE / 2);
        limiter.acquire(Integer.MAX_VALUE);
        assertEvents("R0.00", "R0.00", "R0.00"); // no wait, infinite rate!
    
        limiter.setRate(2.0);
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 21.6K bytes
    - Viewed (0)
  4. 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)
  5. src/runtime/mgclimit.go

    func (l *gcCPULimiterState) limiting() bool {
    	return l.enabled.Load()
    }
    
    // startGCTransition notifies the limiter of a GC transition.
    //
    // This call takes ownership of the limiter and disables all other means of
    // updating the limiter. Release ownership by calling finishGCTransition.
    //
    // It is safe to call concurrently with other operations.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 22:07:41 UTC 2024
    - 17.3K bytes
    - Viewed (0)
  6. 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)
  7. src/cmd/compile/internal/syntax/testdata/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: Wed Mar 30 18:02:18 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top