/** * GAP-PAR-010: Fork-Join Process Pattern. * * Defines the fork-join primitive for spawning multiple process branches * and merging their results according to a join strategy. */ export interface ForkBranch { /** Unique identifier for this branch within the fork. */ id: string; /** Process to execute in this branch. */ processId: string; /** Optional inputs passed to the branch process. */ inputs?: Record; } export type JoinStrategy = 'all' | 'race' | 'allSettled'; export interface ForkSpec { /** The branches to execute in parallel. */ branches: ForkBranch[]; /** How to join the branch results. */ joinStrategy: JoinStrategy; } export interface BranchResult { /** Status of this branch. */ status: 'fulfilled' | 'rejected'; /** Result value if fulfilled. */ value?: unknown; /** Error message if rejected. */ reason?: string; } export interface ForkJoinResult { /** Results keyed by branch ID. */ branchResults: Map; /** ISO timestamp when the join completed. */ joinedAt: string; /** Strategy that was used. */ strategy: JoinStrategy; } /** * Create and validate a ForkSpec from branches and a join strategy. * Throws if branches are empty or contain duplicate IDs. */ export declare function createForkSpec(branches: ForkBranch[], strategy: JoinStrategy): ForkSpec; /** * Merge branch results according to the specified strategy. * * - 'all': All branches must be fulfilled; throws if any rejected. * - 'race': Returns the first fulfilled result only. * - 'allSettled': Returns all results regardless of status. */ export declare function mergeBranchResults(results: Map, strategy: JoinStrategy): ForkJoinResult; //# sourceMappingURL=forkJoin.d.ts.map