- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 192 for newTimer (0.29 sec)
-
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) -
test/typeparam/chansimp.dir/main.go
want := []int{2} if !a.SliceEqual(got, want) { panic(fmt.Sprintf("Filter returned %v, want %v", got, want)) } } func TestSink() { c := a.Sink[int](context.Background()) after := time.NewTimer(time.Minute) defer after.Stop() send := func(v int) { select { case c <- v: case <-after.C: panic("timed out sending to Sink") } } send(1) send(2) send(3) close(c) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 24 02:14:15 UTC 2022 - 3.1K bytes - Viewed (0) -
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) -
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) -
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) -
staging/src/k8s.io/apimachinery/pkg/util/wait/timer.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Mar 14 19:14:11 UTC 2023 - 2.9K bytes - Viewed (0) -
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) -
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) -
internal/dsync/dsync_test.go
if !dm.GetLock(ctx, cancel, id, source, Options{Timeout: 5 * time.Minute}) { t.Fatal("GetLock() should be successful") } // Make it run twice. timer := time.NewTimer(testDrwMutexRefreshInterval * 2) select { case <-ctx.Done(): t.Fatal("Lock context canceled which is not expected") case <-timer.C: } // Should be safe operation in all cases
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Sat Dec 24 03:49:07 UTC 2022 - 11K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/configuration/configuration_manager.go
func (a *poller) notReady() { a.lock.Lock() defer a.lock.Unlock() a.ready = false } func (a *poller) bootstrapping() { // bootstrapGracePeriod is read-only, so no lock is required timer := time.NewTimer(a.bootstrapGracePeriod) go func() { defer timer.Stop() <-timer.C a.lock.Lock() defer a.lock.Unlock() a.bootstrapped = true }() }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Nov 06 02:02:38 UTC 2017 - 4.3K bytes - Viewed (0)