Commit | Line | Data |
---|---|---|
1 | 'use strict' | |
2 | const { ClusterWorker, KillBehaviors } = require('../../../lib/index') | |
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, | |
15 | async: true, | |
16 | killBehavior: KillBehaviors.HARD | |
17 | }) |