File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,23 @@ process.on('uncaughtException', function (err) {
8383 process . exit ( 1 ) ;
8484} ) ;
8585
86- function SCWorkerCluster ( ) {
86+ function SCWorkerCluster ( options ) {
8787 if ( scWorkerCluster ) {
8888 // SCWorkerCluster is a singleton; it can only be instantiated once per process.
8989 throw new InvalidActionError ( 'Attempted to instantiate a worker cluster which has already been instantiated' ) ;
9090 }
91+ options = options || { } ;
9192 scWorkerCluster = this ;
9293
94+ if ( options . run != null ) {
95+ this . run = options . run ;
96+ }
97+
9398 this . _init ( workerInitOptions ) ;
99+ }
100+
101+ SCWorkerCluster . create = function ( options ) {
102+ return new SCWorkerCluster ( options ) ;
94103} ;
95104
96105SCWorkerCluster . prototype . _init = function ( options ) {
You can’t perform that action at this time.
0 commit comments