X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fthread%2FtestWorker.js;h=3945589f80cb088306c278ffcd5610526a615f6a;hb=50b332ec235604105c6290eee79d16ab5757eac1;hp=e6bc434b7df633e501ea1fcf43586451db75fd14;hpb=6db75ad932064c1415ff6f03645929530209a5fe;p=poolifier.git diff --git a/tests/worker-files/thread/testWorker.js b/tests/worker-files/thread/testWorker.js index e6bc434b..3945589f 100644 --- a/tests/worker-files/thread/testWorker.js +++ b/tests/worker-files/thread/testWorker.js @@ -1,17 +1,15 @@ 'use strict' -const { ThreadWorker, KillBehaviors } = require('../../../lib/index') -const { isMainThread } = require('worker_threads') -const TestUtils = require('../../test-utils') -const WorkerFunctions = require('../../test-types') +const { ThreadWorker, KillBehaviors } = require('../../../lib') +const { executeTaskFunction } = require('../../test-utils') +const { TaskFunctions } = require('../../test-types') function test (data) { data = data || {} - data.function = data.function || WorkerFunctions.jsonIntegerSerialization - TestUtils.executeWorkerFunction(data) - return isMainThread + data.function = data.function || TaskFunctions.jsonIntegerSerialization + return executeTaskFunction(data) } module.exports = new ThreadWorker(test, { - maxInactiveTime: 500, - killBehavior: KillBehaviors.HARD + killBehavior: KillBehaviors.HARD, + maxInactiveTime: 500 })