cmd/nsq-to-http/main.go
func backoff(rand *rand.Rand, attempt int, min, max time.Duration) time.Duration {
	if attempt <= 0 {
		panic("tube.Backoff: attempt <= 0")
	}

	if min > max {
		panic("tube.Backoff: min > max")
	}

	// Hardcoded backoff coefficient, maybe we'll make it configuration in the
	// future?
	const coeff = 2.0
	return jitteredBackoff(rand, attempt, min, max, coeff)
}
func backoff(rand *rand.Rand, attempt int, min, max time.Duration) time.Duration {
	if attempt <= 0 {
		panic("tube.Backoff: attempt <= 0")
	}

	if min > max {
		panic("tube.Backoff: min > max")
	}

	// Hardcoded backoff coefficient, maybe we'll make it configuration in the
	// future?
	const coeff = 2.0
	return jitteredBackoff(rand, attempt, min, max, coeff)
}
// backoff computes a random exponential backoff value for a given number of
// attempts, and boundaries of min and max backoff durations.