Interface RunnerOptionsSync<Node, Result>

Options that can define a synchronous graph traversal.

Note that if the visit() method is async, then the promises themselves will be used as the Result type, which is likely not what you want!

interface RunnerOptionsSync<Node, Result> {
    failFast?: boolean;
    getDeps: ((node: Node) => Node[]);
    graph: [node: Node, ...rest: Node[]];
    onCycle?: ((node: Node, cycle: Node[], path: Node[]) => void);
    signal?: AbortSignal;
    visit: ((node: Node, signal: AbortSignal, path: Node[], depResults: DepResults<Node, Result>) => Result);
}

Type Parameters

  • Node
  • Result = void

Hierarchy (view full)

Properties

failFast?: boolean

Set to false to continue operations even if errors occur. If set to false, then an AggregateError will be raised on failure containing all failures (even if only one). If true, then a normal Error will be raised on failure.

true
getDeps: ((node: Node) => Node[])

Get a set of dependency nodes synchronously

graph: [node: Node, ...rest: Node[]]

Array of one or more entry nodes.

onCycle?: ((node: Node, cycle: Node[], path: Node[]) => void)

Handle cycles synchronously

signal?: AbortSignal

a signal that will trigger the graph traversal to end prematurely

visit: ((node: Node, signal: AbortSignal, path: Node[], depResults: DepResults<Node, Result>) => Result)

Visit a node synchronously