build(deps-dev): bump @types/node
[poolifier.git] / tests / worker-files / thread / testWorker.mjs
CommitLineData
b2fd3f4a
JB
1import { KillBehaviors, ThreadWorker } from '../../../lib/index.js'
2import { executeTaskFunction } from '../../test-utils.js'
3import { TaskFunctions } from '../../test-types.js'
4
5/**
6 *
7 * @param data
8 */
9function test (data) {
10 data = data || {}
11 data.function = data.function || TaskFunctions.jsonIntegerSerialization
12 return executeTaskFunction(data)
13}
14
15export default new ThreadWorker(test, {
16 killBehavior: KillBehaviors.HARD,
17 maxInactiveTime: 500
18})