build(deps-dev): bump @types/node
[poolifier.git] / tests / worker-files / thread / asyncErrorWorker.mjs
1 import { KillBehaviors, ThreadWorker } from '../../../lib/index.js'
2 import { sleepTaskFunction } from '../../test-utils.js'
3
4 /**
5 *
6 * @param data
7 */
8 async function error (data) {
9 return sleepTaskFunction(
10 data,
11 2000,
12 true,
13 'Error Message from ThreadWorker:async'
14 )
15 }
16
17 export default new ThreadWorker(error, {
18 killBehavior: KillBehaviors.HARD,
19 maxInactiveTime: 500
20 })