import { BatchPauseExecutionError } from './errors.js';
import { nextSequenceNumber, getCachedResult, getCallSequenceNumber, } from '@mondaydotcomorg/atp-runtime';
export async function batchParallel(batchCalls, parallelId) {
    const currentSequence = getCallSequenceNumber();
    const cachedResult = getCachedResult(currentSequence);
    if (cachedResult !== undefined) {
        nextSequenceNumber();
        return cachedResult;
    }
    const sequenceForPause = nextSequenceNumber();
    throw new BatchPauseExecutionError(batchCalls, parallelId, sequenceForPause);
}
//# sourceMappingURL=batch-parallel.js.map