connpolicy

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package connpolicy holds unexported construction helpers for GON-065 admitted-N formulas used when sizing HTTP connection pools. It is internal: not a Stable library surface. Helpers refuse overflow rather than wrapping to a smaller positive MaxConns under a parallel(N) claim.

Arithmetic is intentionally limited to the positive admitted-N domain used by locked composite formulas (transfer C/L, content workers ≥ 1). It is not a general signed-integer arithmetic library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChecked

func AddChecked(a, b int) (int, error)

AddChecked returns a+b for positive admitted-N components, or an error if either operand is not ≥ 1 or the sum overflows int.

func ContentWorkerPlusEnumerator

func ContentWorkerPlusEnumerator(workers int, enumeratorConcurrent bool) (int, error)

ContentWorkerPlusEnumerator returns workers, or workers+1 when a prefix/glob enumerator may LIST on the same client while workers run.

func MulChecked

func MulChecked(a, b int) (int, error)

MulChecked returns a*b for positive admitted-N components, or an error if either operand is not ≥ 1 or the product overflows int.

func TransferDestAdmittedN

func TransferDestAdmittedN(concurrency int) (int, error)

TransferDestAdmittedN is the destination-client ceiling (transfer workers only).

func TransferSourceAdmittedN

func TransferSourceAdmittedN(concurrency, listConcurrency int, shardingEnabled bool) (int, error)

TransferSourceAdmittedN is the as-built shared-source ceiling for non-reflow transfer: list workers (L) plus transfer workers (C), and an additional L when sharded discovery can overlap regular listing.

Callers must resolve defaults so C and L are positive before calling.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL