build: bump volta pnpm version
[poolifier.git] / examples / typescript / worker.ts
index 143bdab127dbfb334f5545518c1a160c1683dc47..562b21477e31dd1aaa603a087eb33d3c92b4b130 100644 (file)
@@ -1,7 +1,7 @@
 import { ThreadWorker } from 'poolifier'
 
 export interface MyData {
-  ok: number
+  ok: 0 | 1
 }
 
 export interface MyResponse {
@@ -11,10 +11,8 @@ export interface MyResponse {
 
 class MyThreadWorker extends ThreadWorker<MyData, Promise<MyResponse>> {
   constructor () {
-    // eslint-disable-next-line @typescript-eslint/promise-function-async
-    super((data: MyData) => this.process(data), {
-      maxInactiveTime: 60000,
-      async: true
+    super(async (data: MyData) => await this.process(data), {
+      maxInactiveTime: 60000
     })
   }