Emit a RUNTIME_STARTED event to track if the vm has been started

This commit is contained in:
Paul Kaplan 2018-11-27 11:37:01 -05:00
parent bb82c46f8a
commit cc4751228e
4 changed files with 34 additions and 0 deletions
src/engine

View file

@ -597,6 +597,14 @@ class Runtime extends EventEmitter {
return 'BLOCKSINFO_UPDATE';
}
/**
* Event name when the runtime tick loop has been started.
* @const {string}
*/
static get RUNTIME_STARTED () {
return 'RUNTIME_STARTED';
}
/**
* How rapidly we try to step threads by default, in ms.
*/
@ -2158,6 +2166,7 @@ class Runtime extends EventEmitter {
this._steppingInterval = setInterval(() => {
this._step();
}, interval);
this.emit(Runtime.RUNTIME_STARTED);
}
/**