Factor out some UTs code in test-utils.js
[poolifier.git] / tests / worker-files / thread / asyncErrorWorker.js
CommitLineData
7c0ba920
JB
1'use strict'
2const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
15d56315 3const TestUtils = require('../../test-utils')
7c0ba920
JB
4
5async function error (data) {
15d56315
JB
6 return TestUtils.workerSleepFunction(
7 data,
8 2000,
9 true,
10 'Error Message from ThreadWorker:async'
11 )
7c0ba920
JB
12}
13
14module.exports = new ThreadWorker(error, {
15 maxInactiveTime: 500,
16 async: true,
17 killBehavior: KillBehaviors.HARD
18})