Commit | Line | Data |
---|---|---|
325f50bc | 1 | 'use strict' |
1a81f8af | 2 | const { ClusterWorker, KillBehaviors } = require('../../../lib/index') |
325f50bc S |
3 | |
4 | async function error (data) { | |
5 | return new Promise((resolve, reject) => { | |
6 | setTimeout( | |
7 | () => reject(new Error('Error Message from ClusterWorker:async')), | |
8 | 2000 | |
9 | ) | |
10 | }) | |
11 | } | |
12 | ||
13 | module.exports = new ClusterWorker(error, { | |
14 | maxInactiveTime: 500, | |
4c35177b | 15 | async: true, |
1a81f8af | 16 | killBehavior: KillBehaviors.HARD |
325f50bc | 17 | }) |