Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-hybrid...
[poolifier.git] / tests / worker-files / thread / asyncErrorWorker.mjs
1 import { KillBehaviors, ThreadWorker } from '../../../lib/index.cjs'
2 import { sleepTaskFunction } from '../../test-utils.cjs'
3
4 /**
5 *
6 * @param data
7 * @returns
8 */
9 async function error (data) {
10 return sleepTaskFunction(
11 data,
12 2000,
13 true,
14 'Error Message from ThreadWorker:async'
15 )
16 }
17
18 export default new ThreadWorker(error, {
19 killBehavior: KillBehaviors.HARD,
20 maxInactiveTime: 500
21 })