-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemos.cluster.js
38 lines (32 loc) · 992 Bytes
/
demos.cluster.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
*
* Package: concurrency.js
* Author: Ganesh B
* Description: npm module to work with concurrency - worker threads and worker processes easily using simple functions and script files
* Install: npm i concurrency.js --save
* Github: https://github.com/ganeshkbhat/concurrency
* npmjs Link: https://www.npmjs.com/package/concurrency.js
* File: cluster.js
* File Description:
*
*/
/* eslint no-console: 0 */
'use strict';
const path = require("path");
const { _concurrencyClusters } = require("../index.js");
async function cluster() {
let filename = path.join(process.cwd(), "\\src\\worker.cluster.js");
return _concurrencyClusters(
path.join(filename),
// __filename,
8,
{
data: {
url: "https://www.google.com",
message: "Testing parent data"
},
childData: "Test data from child"
}
)
}
module.exports = cluster;