MCPcopy
hub / github.com/OmniDB/OmniDB / Fabric

Function Fabric

OmniDB/OmniDB_app/static/OmniDB_app/lib/cytoscape/cytoscape.js:20647–20675  ·  view source on GitHub ↗
( N )

Source from the content-addressed store, hash-verified

20645var define = _dereq_('./define');
20646
20647var Fabric = function( N ){
20648 if( !(this instanceof Fabric) ){
20649 return new Fabric( N );
20650 }
20651
20652 this._private = {
20653 pass: []
20654 };
20655
20656 var defN = 4;
20657
20658 if( is.number(N) ){
20659 // then use the specified number of threads
20660 } if( typeof navigator !== 'undefined' && navigator.hardwareConcurrency != null ){
20661 N = navigator.hardwareConcurrency;
20662 } else {
20663 try{
20664 N = _dereq_('os').cpus().length;
20665 } catch( err ){
20666 N = defN;
20667 }
20668 } // TODO could use an estimation here but would the additional expense be worth it?
20669
20670 for( var i = 0; i < N; i++ ){
20671 this[i] = new Thread();
20672 }
20673
20674 this.length = N;
20675};
20676
20677var fabfn = Fabric.prototype; // short alias
20678

Callers

nothing calls this directly

Calls 1

_dereq_Function · 0.85

Tested by

no test coverage detected