Options
All
  • Public
  • Public/Protected
  • All
Menu

Module 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.

Index

Functions

broadcast

  • broadcast(event: string, ...args: any[]): void
  • Send a broadcast to all engines. It is equivalent to sending the same event to all engines.

    Parameters

    • event: string

      Event name

    • Rest ...args: any[]

      Event arguments, must be serializable (can be converted to JSON)

    Returns void

execScriptFile

  • 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

    • file: string

      Script or project path

    • Optional 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

  • Get all current running engines.

    Returns ScriptEngine[]

    Array of current running engines

myEngine

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

    Returns SelfScriptEngine

stopAll

  • Stop all engines.

    Parameters

    Returns void