//#region src/channels/restart-policy.ts
const CHANNEL_RESTART_POLICY = {
	maxAttempts: 5,
	baseDelayMs: 1e3,
	maxDelayMs: 6e4,
	jitter: .1
};
function computeBackoff(policy, attempt) {
	const exponentialDelay = Math.min(policy.baseDelayMs * Math.pow(2, attempt - 1), policy.maxDelayMs);
	const jitterRange = exponentialDelay * policy.jitter;
	const jitter = (Math.random() * 2 - 1) * jitterRange;
	return Math.max(0, exponentialDelay + jitter);
}
//#endregion
export { CHANNEL_RESTART_POLICY, computeBackoff };

//# sourceMappingURL=restart-policy.js.map