Skip to content

Home > resol-vbus-core-toolbox > ScriptEngine

ScriptEngine class

The script engine.

Signature:

typescript
export declare class ScriptEngine

Constructors

Constructor

Modifiers

Description

(constructor)()

Create a new script engine.

Properties

Property

Modifiers

Type

Description

completedScriptCount

number

Number of scripts that have already completed.

completionStartGate

StartGate

Used to synchronize all completed scripts.

connections

Connection[]

The list of connections.

connectStartGate

StartGate

Used to synchronize all $.connect calls.

disconnectStartGate

StartGate

Used to synchronize all $.disconnect calls.

isRunning

boolean

Indicates whether the engine is already running.

scripts

Script[]

The list of scripts.

Methods

Method

Modifiers

Description

augmentLiveTransceiverOptions(optionalOptions, channel)

Augment user-provided (or newly create) options for the LiveTransceiver constructor.

createConnection(config)

Create a Connection based on the provided config.

createScript(absFilename)

Create a new script.

defineScript(handler, script)

The defineScript function used inside of scripts.

initializeFromCommandLineArgs(args)

Initialize this script engine from the provided command line arguments.

initializeFromConfig(config, scriptFilenames)

Initialize this script engine from the provided config.

loadConfigFromFile(filename)

Load, parse and return the config from its file contents.

loadScriptFromFile(absFilename)

Load, parse and initialize a script from its file contents.

pumpIncomingData(channel, buffer)

Pump incoming data from a connection to all scripts.

pumpOutgoingData(channel, buffer)

Pump outgoing data from a script to the respective connection.

requireFromScript(id, originDirname)

The require function used inside of scripts.

run()

Run all scripts until they disconnected and completed (or failed).

runScript(script)

Run a script and record its completion.

waitForAllScriptsConnecting()

Wait for all scripts to call $.connect.

waitForAllScriptsDisconnecting()

Wait for all scripts to call $.disconnect.