(
options: Omit<BlockFactoryOptions, 'type'> & {
parallelType?: 'count' | 'collection'
count?: number
} = {}
)
| 147 | * Creates a parallel block (concurrent execution container). |
| 148 | */ |
| 149 | export function createParallelBlock( |
| 150 | options: Omit<BlockFactoryOptions, 'type'> & { |
| 151 | parallelType?: 'count' | 'collection' |
| 152 | count?: number |
| 153 | } = {} |
| 154 | ): any { |
| 155 | const data: BlockData = { |
| 156 | ...options.data, |
| 157 | parallelType: options.parallelType ?? 'count', |
| 158 | count: options.count ?? 2, |
| 159 | type: 'parallel', |
| 160 | } |
| 161 | |
| 162 | return createBlock({ |
| 163 | ...options, |
| 164 | type: 'parallel', |
| 165 | name: options.name ?? 'Parallel', |
| 166 | data, |
| 167 | }) |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Creates a router block (output routing). |
no test coverage detected