Commit | Line | Data |
---|---|---|
1 | import { KillBehaviors, ThreadWorker } from '../../../lib/index.js' | |
2 | import { sleepTaskFunction } from '../../test-utils.js' | |
3 | ||
4 | /** | |
5 | * | |
6 | * @param data | |
7 | * @returns | |
8 | */ | |
9 | async function sleep (data) { | |
10 | return sleepTaskFunction(data, 2000) | |
11 | } | |
12 | ||
13 | export default new ThreadWorker(sleep, { | |
14 | killBehavior: KillBehaviors.HARD, | |
15 | maxInactiveTime: 500 | |
16 | }) |