Commit | Line | Data |
---|---|---|
106744f7 | 1 | 'use strict' |
60fbd6d6 | 2 | const { ThreadWorker } = require('poolifier') |
106744f7 | 3 | |
3a502712 JB |
4 | /** |
5 | * | |
6 | * @param data | |
7 | */ | |
a86b6df1 | 8 | function fn0 (data) { |
c84b1e6e JB |
9 | console.info('Executing fn0') |
10 | return { data: `fn0 input text was '${data.text}'` } | |
106744f7 | 11 | } |
12 | ||
3a502712 JB |
13 | /** |
14 | * | |
15 | * @param data | |
16 | */ | |
a86b6df1 | 17 | function fn1 (data) { |
c84b1e6e JB |
18 | console.info('Executing fn1') |
19 | return { data: `fn1 input text was '${data.text}'` } | |
a86b6df1 JB |
20 | } |
21 | ||
22 | module.exports = new ThreadWorker({ fn0, fn1 }) |