engines


CloudControl Pro 9 Docs / engines

engines

The engines module provides methods to get the current engine, arguments, and configuration of current engine, and functions to get other engines, start new engines, control other engines, and communicate with other engines.

Table of contents

Interfaces

Functions

Functions

broadcast

broadcast(event, ...args): void

Send a broadcast to all engines. It is equivalent to sending the same event to all engines.

Parameters

Name Type Description
event string Event name
...args any[] Event arguments, must be serializable (can be converted to JSON)

Returns

void


execScriptFile

execScriptFile(file, config?): ScriptExecution

Start a new engine to run a script or a project. The script context and environment will be independent from the current context and environment. The script can communicate with other scripts by events or broadcasts.

Parameters

Name Type Description
file string Script or project path
config? ExecutionConfig Execution configuration

Returns

ScriptExecution

Script execution object. It can be used to get engine status, communicate with other scripts, and control the engine.


getRunningEngines

getRunningEngines(): ScriptEngine[]

Get all current running engines.

Returns

ScriptEngine[]

Array of current running engines


myEngine

myEngine(): SelfScriptEngine

Get the engine object of the engine that current script running with.

Returns

SelfScriptEngine


stopAll

stopAll(options?): void

Stop all engines.

Parameters

Name Type Description
options? StopAllOptions 停止所有引擎的选项

Returns

void