Create a new CodeExecutionService
Worker pool configuration options
Execute JavaScript code in a sandboxed environment
The code runs in a worker process with full isolation. If the worker crashes due to catastrophic errors, it will be automatically restarted without affecting this call or the main application.
Execution parameters (code, language, input data, limits)
Execution result with output, logs, or error
Initialize the service and worker pool
This must be called before executing any code. It starts the worker processes and waits for them to be ready.
Shutdown the service and all worker processes
This should be called during application shutdown to gracefully terminate all workers and reject any pending requests.
Service for executing JavaScript code in a secure sandbox
This service manages a pool of worker processes that execute code with full isolation. If a worker crashes due to catastrophic errors, it's automatically restarted without affecting the main application or other workers.