Signature
tsSignature
export function normalizedConcurrency(value: number | undefined, count: number): number;Imports
tsImport
import { normalizedConcurrency } from "@/lib/flow/core/record";import { normalizedConcurrency } from "@/lib/flow";Parameters
valuenumber | undefined
Requested concurrency.
countnumber
Number of available children.
Returns
Safe concurrency limit.
Return type
numberDetails
Non-finite or missing values run all children. Finite values are floored and clamped to the
inclusive range from one to the number of children.
Related Symbols
all
Runs keyed behaviors in parallel and fails fast on the first child failure.
function
from
Converts a structural result-like value into a branded Flow result.
function
run
Runs a behavior with an optional application context.
function
Source
tsflow/core/record.ts:124-134
export function normalizedConcurrency(value: number | undefined, count: number): number { if (count === 0) { return 0; }
if (value === undefined || !Number.isFinite(value)) { return count; }
return Math.max(1, Math.min(count, Math.floor(value)));}