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