parallelNode

inline fun <I, O> parallelNode(name: String, description: String = "", rerunOnResume: Boolean = false, waitForOutput: Boolean = false, maxParallelWorkers: Int? = null, config: NodeConfig = NodeConfig(), inputSchema: Schema? = null, outputSchema: Schema? = null, stateSchema: Schema? = null, crossinline block: suspend FlowCollector<Event>.(context: Context, input: I) -> O): FunctionNode<List<I>, List<O>>

Creates a FunctionNode that runs block concurrently on each item of a list input and returns the results as a List of O in input order. A non-list input runs as one item.

config, the schemas and rerunOnResume apply to each item's run; the fan-out node shares waitForOutput and stateSchema, has no retry or timeout, and always reruns on resume.

Parameters

maxParallelWorkers

Maximum number of items run at a time, or null for no limit.

Throws


inline fun <I, O> parallelNode(node: FunctionNode<I, O>, maxParallelWorkers: Int? = null): FunctionNode<List<I>, List<O>>

Wraps node so it runs concurrently on each item of a list input and returns the results in input order. node's configuration applies to each item's run.

Parameters

maxParallelWorkers

Maximum number of items run at a time, or null for no limit.

Throws