Interface: ScriptEngine
CloudControl Pro 9 Docs / engines / ScriptEngine
Interface: ScriptEngine
engines.ScriptEngine
Script engine object, represents an engine instance of a script or project running. It can be used to communicate with other engines and scripts, get engine status, stop engine running, etc.
Hierarchy
-
ScriptEngine
Table of contents
Properties
Methods
Properties
executionConfig
• Readonly
executionConfig: ReadOnlyExecutionConfig
Get the execution config of this engine.
id
• Readonly
id: number
Unique id of engine, different from other engine's id.
source
• Readonly
source: any
Source file object of engine.
sourceFile
• Readonly
sourceFile: string
Path of engine source file.
workingDirectory
• Readonly
workingDirectory: string
Directory of engine running. Usually is the root directory of project or the parent directory of script file.
Methods
emit
▸ emit(event
, ...args
): void
Send event to engine. For nodejs engine, you can use require("engines").myEngine().on("event", () => {})
to listen event; For pro8 engine, you can use $events.on("event", () => {})
to listen event.
Parameters
Name | Type | Description |
---|---|---|
event |
string |
Event name |
...args |
any [] |
Event arguments, must be a JSON-able data |
Returns
void
forceStop
▸ forceStop(): void
Force stop the engine.
Returns
void
getTag
▸ getTag(key
): any
Returns the tag associated with this engine and the specified key.
Parameters
Name | Type |
---|---|
key |
string |
Returns
any