Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 120 for newTimer (0.16 sec)

  1. staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

    		// So we will be simply closing the channel, and synchronizing on the WaitGroup.
    		stopCh:           stopCh,
    		clock:            config.Clock,
    		timer:            time.NewTimer(time.Duration(0)),
    		bookmarkWatchers: newTimeBucketWatchers(config.Clock, defaultBookmarkFrequency),
    	}
    
    	// Ensure that timer is stopped.
    	if !cacher.timer.Stop() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  2. cmd/erasure-server-pool-rebalance.go

    		// time.
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		randSleepFor := func() time.Duration {
    			return 5*time.Second + time.Duration(float64(5*time.Second)*r.Float64())
    		}
    
    		timer := time.NewTimer(randSleepFor())
    		defer timer.Stop()
    
    		var (
    			quit     bool
    			traceMsg string
    		)
    
    		for {
    			select {
    			case rebalErr := <-doneCh:
    				quit = true
    				now := time.Now()
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 03 15:45:54 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  3. src/os/exec/exec.go

    			err = wrappedError{
    				prefix: "exec: canceling Cmd",
    				err:    interruptErr,
    			}
    		}
    	}
    	if c.WaitDelay == 0 {
    		resultc <- ctxResult{err: err}
    		return
    	}
    
    	timer := time.NewTimer(c.WaitDelay)
    	select {
    	case resultc <- ctxResult{err: err, timer: timer}:
    		// c.Process.Wait returned and we've handed the timer off to c.Wait.
    		// It will take care of goroutine shutdown from here.
    		return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 41.4K bytes
    - Viewed (0)
  4. src/net/dial.go

    	// Start the main racer.
    	primaryCtx, primaryCancel := context.WithCancel(ctx)
    	defer primaryCancel()
    	go startRacer(primaryCtx, true)
    
    	// Start the timer for the fallback racer.
    	fallbackTimer := time.NewTimer(sd.fallbackDelay())
    	defer fallbackTimer.Stop()
    
    	for {
    		select {
    		case <-fallbackTimer.C:
    			fallbackCtx, fallbackCancel := context.WithCancel(ctx)
    			defer fallbackCancel()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 26.9K bytes
    - Viewed (0)
  5. pkg/istio-agent/xds_proxy.go

    			Node:                   req.Node,
    			TypeUrl:                req.TypeUrl,
    			ResourceNamesSubscribe: req.ResourceNames,
    		})
    	} else {
    		connection.sendRequest(req)
    	}
    
    	delay := time.NewTimer(timeout)
    	defer delay.Stop()
    
    	// Wait for expected response or timeout
    	for {
    		select {
    		case res := <-p.tapResponseChannel:
    			if res.TypeUrl == req.TypeUrl {
    				return res, nil
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 16 22:12:28 UTC 2024
    - 27.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go

    	// resourceVersion=0 is the most common case.
    	if resourceVersion > 0 {
    		go func() {
    			// Wake us up when the time limit has expired.  The docs
    			// promise that time.After (well, NewTimer, which it calls)
    			// will wait *at least* the duration given. Since this go
    			// routine starts sometime after we record the start time, and
    			// it will wake up the loop below sometime after the broadcast,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 10:20:57 UTC 2024
    - 26.2K bytes
    - Viewed (0)
  7. src/time/time_test.go

    // and that we also don't panic.
    func TestConcurrentTimerReset(t *testing.T) {
    	const goroutines = 8
    	const tries = 1000
    	var wg sync.WaitGroup
    	wg.Add(goroutines)
    	timer := NewTimer(Hour)
    	for i := 0; i < goroutines; i++ {
    		go func(i int) {
    			defer wg.Done()
    			for j := 0; j < tries; j++ {
    				timer.Reset(Hour + Duration(i*j))
    			}
    		}(i)
    	}
    	wg.Wait()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  8. src/net/http/transfer.go

    		var buf [1]byte
    		var rres readResult
    		rres.n, rres.err = body.Read(buf[:])
    		if rres.n == 1 {
    			rres.b = buf[0]
    		}
    		t.ByteReadCh <- rres
    		close(t.ByteReadCh)
    	}(t.Body)
    	timer := time.NewTimer(200 * time.Millisecond)
    	select {
    	case rres := <-t.ByteReadCh:
    		timer.Stop()
    		if rres.n == 0 && rres.err == io.EOF {
    			// It was empty.
    			t.Body = nil
    			t.ContentLength = 0
    		} else if rres.n == 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache_test.go

    	wc.upperBoundCapacity = max(capacity, defaultUpperBoundCapacity)
    
    	return wc
    }
    
    type immediateTickerFactory struct{}
    
    func (t *immediateTickerFactory) NewTimer(d time.Duration) clock.Timer {
    	timer := immediateTicker{
    		c: make(chan time.Time),
    	}
    	timer.Reset(d)
    	return &timer
    }
    
    type immediateTicker struct {
    	c chan time.Time
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 09:20:10 UTC 2024
    - 35.4K bytes
    - Viewed (0)
  10. src/cmd/go/internal/script/cmds.go

    			if len(args) != 1 {
    				return nil, ErrUsage
    			}
    
    			d, err := time.ParseDuration(args[0])
    			if err != nil {
    				return nil, err
    			}
    
    			timer := time.NewTimer(d)
    			wait := func(s *State) (stdout, stderr string, err error) {
    				ctx := s.Context()
    				select {
    				case <-ctx.Done():
    					timer.Stop()
    					return "", "", ctx.Err()
    				case <-timer.C:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 28.5K bytes
    - Viewed (0)
Back to top