Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for NextBackOff (0.28 sec)

  1. pkg/backoff/exponential.go

    import (
    	"context"
    	"fmt"
    	"time"
    
    	"github.com/cenkalti/backoff/v4"
    )
    
    // BackOff is a backoff policy for retrying an operation.
    type BackOff interface {
    	// NextBackOff returns the duration to wait before retrying the next operation.
    	NextBackOff() time.Duration
    	// Reset to initial state.
    	Reset()
    	// RetryWithContext tries the operation until it does not return error,
    	// or when the context expires, whichever happens first.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 25 01:53:48 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  2. pkg/wasm/httpfetcher.go

    			if ctx.Err() != nil {
    				// If there is context timeout, exit this loop.
    				return nil, fmt.Errorf("wasm module download failed after %v attempts, last error: %v", attempts, lastError)
    			}
    			time.Sleep(b.NextBackOff())
    			continue
    		}
    		if resp.StatusCode == http.StatusOK {
    			// Limit wasm module to 256mb; in reality it must be much smaller
    			body, err := io.ReadAll(io.LimitReader(resp.Body, 1024*1024*256))
    			if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 14 20:23:34 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  3. pkg/backoff/exponential_test.go

    		minInterval := expected - time.Duration(DefaultRandomizationFactor*float64(expected))
    		maxInterval := expected + time.Duration(DefaultRandomizationFactor*float64(expected))
    		actualInterval := exp.NextBackOff()
    		if !(minInterval <= actualInterval && actualInterval <= maxInterval) {
    			t.Error("error")
    		}
    	}
    }
    
    type TestClock struct {
    	i     time.Duration
    	start time.Time
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 05 16:03:30 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  4. pkg/adsc/delta.go

    	c.mutex.RLock()
    	if c.closed {
    		c.mutex.RUnlock()
    		return
    	}
    	c.mutex.RUnlock()
    
    	err := c.Run(context.Background())
    	if err != nil {
    		time.AfterFunc(c.cfg.BackoffPolicy.NextBackOff(), c.reconnect)
    	} else if c.cfg.BackoffPolicy != nil {
    		// We connected, so reset the backoff
    		c.cfg.BackoffPolicy.Reset()
    	}
    }
    
    type Option func(c *Client)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 02 09:32:41 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  5. pkg/adsc/adsc.go

    	a.mutex.RLock()
    	if a.closed {
    		a.mutex.RUnlock()
    		return
    	}
    	a.mutex.RUnlock()
    
    	err := a.Run()
    	if err != nil {
    		// TODO: fix reconnect
    		time.AfterFunc(a.cfg.BackoffPolicy.NextBackOff(), a.reconnect)
    	}
    }
    
    func (a *ADSC) handleRecv() {
    	// We connected, so reset the backoff
    	if a.cfg.BackoffPolicy != nil {
    		a.cfg.BackoffPolicy.Reset()
    	}
    	for {
    		var err error
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Feb 05 22:18:49 UTC 2024
    - 35K bytes
    - Viewed (0)
Back to top