docs: refine changelog entries
[poolifier.git] / tests / worker-files / thread / asyncErrorWorker.mjs
CommitLineData
d35e5717
JB
1import { KillBehaviors, ThreadWorker } from '../../../lib/index.cjs'
2import { sleepTaskFunction } from '../../test-utils.cjs'
7c0ba920 3
b2fd3f4a
JB
4/**
5 *
6 * @param data
2eb14889 7 * @returns
b2fd3f4a 8 */
7c0ba920 9async function error (data) {
dbca3be9 10 return sleepTaskFunction(
15d56315
JB
11 data,
12 2000,
13 true,
14 'Error Message from ThreadWorker:async'
15 )
7c0ba920
JB
16}
17
b2fd3f4a 18export default new ThreadWorker(error, {
cca3bb1a
JB
19 killBehavior: KillBehaviors.HARD,
20 maxInactiveTime: 500
7c0ba920 21})