mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
23 lines
449 B
JavaScript
23 lines
449 B
JavaScript
![]() |
|
||
|
module.exports = collection;
|
||
|
|
||
|
|
||
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||
|
|
||
|
var cluster = require('cluster');
|
||
|
|
||
|
if (cluster.isMaster)
|
||
|
var Collection = require('./master/Collection.js');
|
||
|
else
|
||
|
var Collection = require('./worker/Collection.js');
|
||
|
|
||
|
|
||
|
var collections = {};
|
||
|
|
||
|
function collection(name) {
|
||
|
if (!hasOwnProperty.call(collections, name))
|
||
|
return collections[name] = new Collection(name);
|
||
|
else
|
||
|
return collections[name];
|
||
|
}
|