Genel bakış
functionCore Runtime

createLinkedController

Creates a child controller linked to a parent signal.

Signature

tsSignature
export function createLinkedController(parent: AbortSignal): {
controller: AbortController;
unlink: () => void;
};

Imports

tsImport
import { createLinkedController } from "@/lib/flow/core/runtime";
import { createLinkedController } from "@/lib/flow";

Parameters

parent
AbortSignal

Parent signal to link from.

Returns

The child controller and an unlink cleanup function.

Return type
{ controller: AbortController; unlink: () => void; }

Details

This advanced helper powers timeout, race, and parallel execution helpers.

race

Runs keyed behaviors and returns the first settled child.

function

Source

tsflow/core/runtime.ts:332-340
export function createLinkedController(parent: AbortSignal): {
controller: AbortController;
unlink: () => void;
} {
const controller = new AbortController();
const unlink = linkAbortSignal(parent, controller);
return { controller, unlink };
}