feat: optimize process & plugin loader and scanner

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-06-30 15:58:51 +08:00
parent 14eef46e67
commit e28af3fbbc
6 changed files with 50 additions and 34 deletions

View File

@ -28,8 +28,9 @@ class Process extends EventEmitter {
queueMicrotask(func: Function) {
microTaskPool.execute(func)
}
exit() {
microTaskPool.shutdown();
exit(code: number) {
process.emit('exit', code)
microTaskPool.shutdown()
}
}
global.setGlobal('process', new Process(), {})