From: Jérôme Benoit Date: Sun, 25 Jun 2023 14:28:20 +0000 (+0200) Subject: fix: node-worker-threads-pool needs inline imports in code block X-Git-Tag: v2.6.4~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=07783b850f6ca370b70c7638ac3df07877aaf201;p=poolifier.git fix: node-worker-threads-pool needs inline imports in code block Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.mjs b/benchmarks/versus-external-pools/functions/function-to-bench.mjs index 4705273c..26f56d04 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.mjs +++ b/benchmarks/versus-external-pools/functions/function-to-bench.mjs @@ -1,6 +1,3 @@ -import crypto from 'crypto' -import fs from 'fs' - /** * The worker function to execute during pools benchmarks. * NOTE: This function requires to be self-contained, thread-safe and re-entrant. @@ -8,6 +5,8 @@ import fs from 'fs' * @returns {*} The result. */ export default function functionToBench (data) { + const crypto = import('crypto') + const fs = import('fs') const TaskTypes = { CPU_INTENSIVE: 'CPU_INTENSIVE', IO_INTENSIVE: 'IO_INTENSIVE'