Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 146 for newTimer (0.12 sec)

  1. doc/next/6-stdlib/1-time.md

    is in a module with a `go.mod` `go` line using Go 1.23.0 or later.
    When Go 1.23 builds older programs, the old behaviors remain in effect.
    The new [GODEBUG setting](/doc/godebug) [`asynctimerchan=1`](/pkg/time/#NewTimer)
    can be used to revert back to asynchronous channel behaviors
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 20:49:22 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. src/time/tick_test.go

    			}
    		})
    	}
    
    	run(t, "After", func() { After(Hour) })
    	run(t, "Tick", func() { Tick(Hour) })
    	run(t, "NewTimer", func() { NewTimer(Hour) })
    	run(t, "NewTicker", func() { NewTicker(Hour) })
    	run(t, "NewTimerStop", func() { NewTimer(Hour).Stop() })
    	run(t, "NewTickerStop", func() { NewTicker(Hour).Stop() })
    }
    
    func TestChan(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:10:37 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  3. internal/http/server.go

    		}
    		return interval
    	}
    
    	// Wait for opened connection to be closed up to Shutdown timeout.
    	shutdownTimeout := srv.ShutdownTimeout
    	shutdownTimer := time.NewTimer(shutdownTimeout)
    	defer shutdownTimer.Stop()
    
    	timer := time.NewTimer(nextPollInterval())
    	defer timer.Stop()
    	for {
    		select {
    		case <-shutdownTimer.C:
    			if atomic.LoadInt32(&srv.requestCount) <= 0 {
    				return nil
    			}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Feb 09 21:25:16 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  4. cmd/license-update.go

    			}
    			time.Sleep(duration)
    		}
    	}()
    }
    
    func licenceUpdaterLoop(ctx context.Context, objAPI ObjectLayer) {
    	ctx, cancel := globalLeaderLock.GetLock(ctx)
    	defer cancel()
    
    	licenseUpdateTimer := time.NewTimer(licUpdateCycle)
    	defer licenseUpdateTimer.Stop()
    
    	for {
    		select {
    		case <-ctx.Done():
    			return
    		case <-licenseUpdateTimer.C:
    
    			if globalSubnetConfig.Registered() {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  5. src/internal/poll/splice_linux_test.go

    	timeout := 5 * time.Minute
    	if deadline, ok := t.Deadline(); ok {
    		timeout = deadline.Sub(time.Now())
    		timeout -= timeout / 10 // Leave 10% headroom for cleanup.
    	}
    	expiredTime := time.NewTimer(timeout)
    	defer expiredTime.Stop()
    
    	// Trigger garbage collection repeatedly, waiting for all pipes in sync.Pool
    	// to either be deallocated and closed, or to time out.
    	for {
    		runtime.GC()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:49:26 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  6. internal/cachevalue/cache_test.go

    package cachevalue
    
    import (
    	"context"
    	"errors"
    	"testing"
    	"time"
    )
    
    func slowCaller(ctx context.Context) error {
    	sl := time.NewTimer(time.Second)
    	defer sl.Stop()
    
    	select {
    	case <-sl.C:
    	case <-ctx.Done():
    		return ctx.Err()
    	}
    
    	return nil
    }
    
    func TestCacheCtx(t *testing.T) {
    	cache := New[time.Time]()
    	t.Parallel()
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 09 00:51:34 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  7. pkg/kubelet/kuberuntime/kuberuntime_termination_order.go

    func (o *terminationOrdering) waitForTurn(name string, gracePeriod int64) float64 {
    	// if there is no grace period, we don't wait
    	if gracePeriod <= 0 {
    		return 0
    	}
    
    	start := time.Now()
    	remainingGrace := time.NewTimer(time.Duration(gracePeriod) * time.Second)
    
    	for _, c := range o.prereqs[name] {
    		select {
    		case <-c:
    		case <-remainingGrace.C:
    			// grace period expired, so immediately exit
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 18 00:07:21 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  8. pkg/test/loadbalancersim/timer/queue.go

    	resetTimerCh    chan struct{}
    	stopping        bool
    	timer           *time.Timer
    	currentDeadline time.Time
    }
    
    func NewQueue() *Queue {
    	q := &Queue{
    		heap:         make(timerHeap, 0),
    		timer:        time.NewTimer(1 * time.Minute),
    		stopCh:       make(chan struct{}),
    		resetTimerCh: make(chan struct{}),
    	}
    
    	// Start the worker thread.
    	go func() {
    		for {
    			select {
    			case <-q.stopCh:
    				q.stopTimer()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 19:13:32 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  9. tools/istio-iptables/pkg/validation/validator.go

    	log.Infof("Starting iptables validation. This check verifies that iptables rules are properly established for the network.")
    	s := Service{
    		validator.Config,
    	}
    	sError := make(chan error, 1)
    	sTimer := time.NewTimer(s.Config.ProbeTimeout)
    	defer sTimer.Stop()
    	go func() {
    		sError <- s.Run()
    	}()
    
    	// infinite loop
    	go func() {
    		c := Client{Config: validator.Config}
    		<-c.Config.ServerReadyBarrier
    		for {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Nov 01 04:37:36 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  10. cmd/callhome.go

    		return true
    	}
    
    	ctx = lkctx.Context()
    	defer locker.Unlock(lkctx)
    
    	// Perform callhome once and then keep running it at regular intervals.
    	performCallhome(ctx)
    
    	callhomeTimer := time.NewTimer(globalCallhomeConfig.FrequencyDur())
    	defer callhomeTimer.Stop()
    
    	for {
    		if !globalCallhomeConfig.Enabled() {
    			// Stop the processing as callhome got disabled
    			return false
    		}
    
    		select {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 17 16:53:34 UTC 2024
    - 5.3K bytes
    - Viewed (0)
Back to top