X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fworker.ts;h=caf6e3ac4787fb2389da3464560a9f684c751c7b;hb=8974e0633f6c99528bf3590e7c76820b2c69d3e2;hp=adc8c4345ca1ead79eec6d31507e7fc07e53f7af;hpb=f33d3b695acf3a30d0b9988c211166c916aca0c5;p=poolifier.git diff --git a/examples/typescript/worker.ts b/examples/typescript/worker.ts index adc8c434..caf6e3ac 100644 --- a/examples/typescript/worker.ts +++ b/examples/typescript/worker.ts @@ -13,13 +13,12 @@ class MyThreadWorker extends ThreadWorker> { constructor () { // eslint-disable-next-line @typescript-eslint/promise-function-async super((data: MyData) => this.process(data), { - maxInactiveTime: 60000, - async: true + maxInactiveTime: 60000 }) } private async process (data: MyData): Promise { - return await new Promise(resolve => { + return await new Promise((resolve) => { setTimeout(() => { resolve({ message: 'Hello from Worker :)', data }) }, 10000)