Skip to main content
Version: 4.x

NEWEXECUTOR operator

The NEWEXECUTOR operator creates an action that enables executing other actions in a new thread pool.

Syntax

NEWEXECUTOR action THREADS threadExpr

Description

The NEWEXECUTOR operator creates an action that creates a new thread pool and executes the defined action in such a way that any action created with the NEWTHREAD operator will be executed in one of the threads of the created pool.

Parameters

Examples

testExecutor  {
NEWEXECUTOR {
FOR id(Sku s) DO {
NEWTHREAD {
NEWSESSION {
name(s) <- STRING[20](id(s)); // writing the code into the name in 10 threads
APPLY;
}
}
}
} THREADS 10;
}