refactor: refine TS example
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 16 Nov 2023 17:50:09 +0000 (18:50 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 16 Nov 2023 17:50:09 +0000 (18:50 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
examples/typescript/pool.ts

index 3d9d9e6f482723cdb634e98bd02a9bbd46df3314..de49c93ad6f8c73bc3cfaa680a78134cdd8daa56 100644 (file)
@@ -38,3 +38,9 @@ export const dynamicPool = new DynamicThreadPool<MyData, Promise<MyResponse>>(
     }
   }
 )
+
+// eslint-disable-next-line @typescript-eslint/no-misused-promises
+setTimeout(async () => {
+  await fixedPool.destroy()
+  await dynamicPool.destroy()
+}, 3000)