MCPcopy
hub / github.com/simstudioai/sim / createParallelBlock

Function createParallelBlock

packages/testing/src/factories/block.factory.ts:149–168  ·  view source on GitHub ↗
(
  options: Omit<BlockFactoryOptions, 'type'> & {
    parallelType?: 'count' | 'collection'
    count?: number
  } = {}
)

Source from the content-addressed store, hash-verified

147 * Creates a parallel block (concurrent execution container).
148 */
149export 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).

Callers 1

utils.test.tsFile · 0.90

Calls 1

createBlockFunction · 0.70

Tested by

no test coverage detected