forked from josdejong/workerpool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (26 loc) · 709 Bytes
/
index.js
File metadata and controls
31 lines (26 loc) · 709 Bytes
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
var environment = require('./lib/environment');
/**
* Create a new worker pool
* @param {Object} [options]
* @returns {Pool} pool
*/
exports.pool = function pool(script, options) {
var Pool = require('./lib/Pool');
return new Pool(script, options);
};
/**
* Create a worker and optionally register a set of methods to the worker.
* @param {Object} [methods]
*/
exports.worker = function worker(methods) {
var worker = require('./lib/worker');
worker.add(methods);
};
/**
* Create a promise.
* @type {Promise} promise
*/
exports.Promise = require('./lib/Promise');
exports.platform = environment.platform;
exports.isMainThread = environment.isMainThread;
exports.cpus = environment.cpus;