mogami-stream - v0.4.0
    Preparing search index...

    Interface PredicateRouteOptions<T, R, D>

    Options for executing a stream pipeline.

    interface PredicateRouteOptions<
        T,
        R extends Record<string, RoutePredicate<T>>,
        D extends keyof R & string | undefined = undefined,
    > {
        branches: R;
        capacity: number;
        default?: D;
        fallback?: "error" | "ignore";
        select?: undefined;
        signal?: AbortSignal;
    }

    Type Parameters

    • T
    • R extends Record<string, RoutePredicate<T>>
    • D extends keyof R & string | undefined = undefined

    Hierarchy (View Summary)

    Index
    branches: R

    Predicates captured in Object.keys order at construction; first match wins. Departed endpoints still participate in classification, with no fallthrough. Each predicate receives the same context for an item. Only synchronous type guards narrow values, using each branch's own guard without excluding earlier matches.

    capacity: number

    Positive safe integer limiting each branch queue, excluding the coordinator's single item.

    default?: D

    Existing branch for unmatched items or departed destinations; its predicate is not reevaluated. All possible default destinations keep the original input type, including union-valued defaults.

    fallback?: "error" | "ignore"

    Handles items with no active destination after trying default. Defaults to "ignore".

    select?: undefined
    signal?: AbortSignal

    External AbortSignal to cancel the execution. If already aborted, the source is never opened.