Child

class containing parentPort and a gameContext of a child thread Child most of the time you want to use the method on to trigger event

Constructor

new Child()

Members

gameContext :Context

Type:
  • Context

promises :Object.<string, Promise>

Type:
  • Object.<string, Promise>

Methods

dispatch(eventID, data) → {Promise}

Parameters:
NameTypeDescription
eventIDstring

event to notify listener of

dataobject

serializable data

Returns:
  • promise resolving when event has finished
Type: 
Promise

on(eventID, promise)

Add a listener to parent thread message

Parameters:
NameTypeDescription
eventIDstring

event id

promisePromiseListener | undefined

callback return a promise or nothing

start(gameScriptClass)

Run child process which can be summarize as so: Listen EVENT of the parent and wait the gameobject When gameobject is received launch a Context and step it over time

Parameters:
NameTypeDescription
gameScriptClassObject.<string, function()>

class needs by object3D