Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for delayFunc (0.14 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/wait/delay.go

    import (
    	"context"
    	"sync"
    	"time"
    
    	"k8s.io/utils/clock"
    )
    
    // DelayFunc returns the next time interval to wait.
    type DelayFunc func() time.Duration
    
    // Timer takes an arbitrary delay function and returns a timer that can handle arbitrary interval changes.
    // Use Backoff{...}.Timer() for simple delays and more efficient timers.
    func (fn DelayFunc) Timer(c clock.Clock) Timer {
    	return &variableTimer{fn: fn, new: c.NewTimer}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 19:14:11 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/wait/backoff.go

    // zero no backoff will be performed as the same calling DelayFunc with a zero factor
    // and steps.
    func (b Backoff) DelayWithReset(c clock.Clock, resetInterval time.Duration) DelayFunc {
    	if b.Factor <= 0 {
    		return b.DelayFunc()
    	}
    	if resetInterval <= 0 {
    		b.Steps = 0
    		b.Factor = 0
    		return b.DelayFunc()
    	}
    	return (&backoffManager{
    		backoff:        b,
    		initialBackoff: b,
    		resetInterval:  resetInterval,
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 19:14:11 UTC 2023
    - 16.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go

    func (f *defaultFeatureSupportChecker) checkClient(ctx context.Context, c client) {
    	// start with 10 ms, multiply by 2 each step, until 15 s and stays on 15 seconds.
    	delayFunc := wait.Backoff{
    		Duration: 10 * time.Millisecond,
    		Cap:      15 * time.Second,
    		Factor:   2.0,
    		Steps:    11}.DelayFunc()
    	f.lock.Lock()
    	defer f.lock.Unlock()
    	for _, ep := range c.Endpoints() {
    		if _, found := f.checkingEndpoint[ep]; found {
    			continue
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 11:56:42 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/wait/loop_test.go

    	// of the behavior of the loop, but tests that we drive the scenario to completion.
    	tests := []struct {
    		name               string
    		delayFn            DelayFunc
    		immediate          bool
    		sliding            bool
    		context            func() (context.Context, context.CancelFunc)
    		callback           func(calls int, lastInterval time.Duration) (bool, error)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:48:08 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/wait/timer.go

    	close(ch)
    	return noopTimer{closedCh: ch}
    }
    
    func (t noopTimer) C() <-chan time.Time {
    	return t.closedCh
    }
    func (noopTimer) Next() {}
    func (noopTimer) Stop() {}
    
    type variableTimer struct {
    	fn  DelayFunc
    	t   clock.Timer
    	new func(time.Duration) clock.Timer
    }
    
    func (t *variableTimer) C() <-chan time.Time {
    	if t.t == nil {
    		d := t.fn()
    		t.t = t.new(d)
    	}
    	return t.t.C()
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 19:14:11 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  6. pkg/scheduler/framework/plugins/volumebinding/binder_test.go

    				t.Fatalf("failed to update PVC %q", getPVCName(scenario.apiPVC))
    			}
    		}
    
    		if scenario.delayFunc != nil {
    			go func(scenario scenarioType) {
    				time.Sleep(5 * time.Second)
    				// Sleep a while to run after bindAPIUpdate in BindPodVolumes
    				logger.V(5).Info("Running delay function")
    				scenario.delayFunc(t, ctx, testEnv, pod, scenario.initPVs, scenario.initPVCs)
    			}(scenario)
    		}
    
    		// Execute
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 09:46:58 UTC 2024
    - 82.8K bytes
    - Viewed (0)
Back to top