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