feat: support async task
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
b87b94aade
commit
55a6b33110
@ -12,6 +12,7 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
@ -34,4 +35,4 @@
|
||||
"@ms/plugin": "^0.1.1",
|
||||
"@ms/sponge": "^0.1.1"
|
||||
}
|
||||
}
|
||||
}
|
@ -37,9 +37,9 @@ class MiaoScriptCore {
|
||||
|
||||
loadTaskFunction() {
|
||||
//@ts-ignore
|
||||
global.setTimeout = (func: Function, tick: number) => this.taskManager.create(func).later(tick).submit()
|
||||
global.setTimeout = (func: Function, tick: number, async: boolean = false) => this.taskManager.create(func).later(tick).async(async).submit()
|
||||
//@ts-ignore
|
||||
global.setInterval = (func: Function, tick: number) => this.taskManager.create(func).timer(tick).submit()
|
||||
global.setInterval = (func: Function, tick: number, async: boolean = false) => this.taskManager.create(func).timer(tick).async(async).submit()
|
||||
}
|
||||
|
||||
loadPlugins() {
|
||||
|
Loading…
Reference in New Issue
Block a user