feat: support async task
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
736760b2ee
commit
c0106e941b
@ -12,6 +12,7 @@
|
|||||||
"homepage": "https://github.com/circlecloud/ms.git",
|
"homepage": "https://github.com/circlecloud/ms.git",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
"typings": "dist/index.d.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
@ -34,4 +35,4 @@
|
|||||||
"@ms/plugin": "^0.1.1",
|
"@ms/plugin": "^0.1.1",
|
||||||
"@ms/sponge": "^0.1.1"
|
"@ms/sponge": "^0.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -37,9 +37,9 @@ class MiaoScriptCore {
|
|||||||
|
|
||||||
loadTaskFunction() {
|
loadTaskFunction() {
|
||||||
//@ts-ignore
|
//@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
|
//@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() {
|
loadPlugins() {
|
||||||
|
Loading…
Reference in New Issue
Block a user