@brown-ds/distribution 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const status=function(_0xaf222){const _0x49effd={};return _0x49effd['gid']=_0xaf222['gid']||'all',{'get':(_0x2c8358,_0x2b080c)=>{const _0x2f73eb=[_0x2c8358],_0x2a83d2={'service':'status','method':'get'};global['distributi'+'on'][_0x49effd['gid']]['comm']['send'](_0x2f73eb,_0x2a83d2,(_0x2c0694,_0x33d7ff)=>{switch(_0x2c8358){case'heapTotal':const _0x297e00=Object['values'](_0x33d7ff)['reduce']((_0x1310f3,_0x19f39b)=>{return _0x1310f3+_0x19f39b;},-0xfb6+0x7e*0xc+0xa*0xfb);_0x2b080c(_0x2c0694,_0x297e00);break;case'nid':const _0x394095=Object['values'](_0x33d7ff)['reduce']((_0x26e757,_0x4187a4)=>{return _0x26e757['concat'](_0x4187a4);},[]);_0x2b080c(_0x2c0694,_0x394095);break;default:_0x2b080c(_0x2c0694,_0x33d7ff);break;}});},'spawn':(_0x41ef1d,_0x4b51b8)=>{_0x4b51b8=_0x4b51b8||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x41ef1d,(_0x5aaae3,_0xd9dea9)=>{_0x5aaae3?_0x4b51b8(_0x5aaae3):global['distributi'+'on']['local']['groups']['add'](_0x49effd['gid'],_0x41ef1d,()=>{_0x4b51b8(null,_0xd9dea9);}),global['distributi'+'on'][_0x49effd['gid']]['comm']['send']([_0x49effd['gid'],_0x41ef1d],{'service':'groups','method':'add'},()=>{});});},'stop':_0x322fe9=>{global['distributi'+'on'][_0x49effd['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x322fe9);}};};module['exports']=status;
9
+ const status=function(_0x361efc){const _0x53485f={};return _0x53485f['gid']=_0x361efc['gid']||'all',{'get':(_0x486e4d,_0x166577)=>{const _0x2202e4=[_0x486e4d],_0x2031b2={'service':'status','method':'get'};global['distributi'+'on'][_0x53485f['gid']]['comm']['send'](_0x2202e4,_0x2031b2,(_0x4bd946,_0x5c9923)=>{switch(_0x486e4d){case'heapTotal':const _0x32b8e5=Object['values'](_0x5c9923)['reduce']((_0x88d14a,_0x19f390)=>{return _0x88d14a+_0x19f390;},-0x1561+0x420+0x1141);_0x166577(_0x4bd946,_0x32b8e5);break;case'nid':const _0x17b9ad=Object['values'](_0x5c9923)['reduce']((_0x4aa102,_0x30d543)=>{return _0x4aa102['concat'](_0x30d543);},[]);_0x166577(_0x4bd946,_0x17b9ad);break;default:_0x166577(_0x4bd946,_0x5c9923);break;}});},'spawn':(_0x1a4792,_0x1807e0)=>{_0x1807e0=_0x1807e0||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x1a4792,(_0x1b39e2,_0x5e57a4)=>{_0x1b39e2?_0x1807e0(_0x1b39e2):global['distributi'+'on']['local']['groups']['add'](_0x53485f['gid'],_0x1a4792,()=>{_0x1807e0(null,_0x5e57a4);}),global['distributi'+'on'][_0x53485f['gid']]['comm']['send']([_0x53485f['gid'],_0x1a4792],{'service':'groups','method':'add'},()=>{});});},'stop':_0x532f5e=>{global['distributi'+'on'][_0x53485f['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x532f5e);}};};module['exports']=status;
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':global['distributi'+'on']['util']['id']['getSID'](global['nodeConfig']),'nid':global['distributi'+'on']['util']['id']['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0xed5bd,_0x2ae74d){_0x2ae74d=_0x2ae74d||function(){};if(_0xed5bd in global['nodeConfig']){_0x2ae74d(null,global['nodeConfig'][_0xed5bd]);return;}if(_0xed5bd in global['moreStatus']){_0x2ae74d(null,global['moreStatus'][_0xed5bd]);return;}if(_0xed5bd==='heapTotal'){_0x2ae74d(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0xed5bd==='heapUsed'){_0x2ae74d(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x2ae74d(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),{spawn,execSync}=require('child_proc'+'ess');function getDistribution(){let _0x498053=path['join'](process['cwd'](),'distributi'+'on.js');if(fs['existsSync'](_0x498053))return _0x498053;try{const _0x5d3be6=execSync('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x498053=path['join'](_0x5d3be6,'distributi'+'on.js');if(fs['existsSync'](_0x498053))return _0x498053;}catch(_0x3a5232){}_0x498053=path['join'](__dirname,'../../dist'+'ribution.j'+'s');if(fs['existsSync'](_0x498053))return _0x498053;return null;}const createSpawnedCb=function(_0x3abc12,_0x8164b8){const _0x3b55d4='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x3abc12['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+global['distributi'+'on']['util']['wire']['createRPC'](global['distributi'+'on']['util']['wire']['toAsync'](_0x8164b8))['toString']()+(';\x0a\x0a\x20\x20\x20\x20try'+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20onStart()'+';\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(null,\x20gl'+'obal.nodeC'+'onfig,\x20()\x20'+'=>\x20{});\x0a\x20\x20'+'\x20\x20}\x0a\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20ca'+'llbackRPC('+'e,\x20null,\x20('+')\x20=>\x20{});\x0a'+'\x20\x20\x20\x20}\x0a\x20\x20\x20\x20');return new Function(_0x3b55d4);};status['spawn']=function(_0x2a33fe,_0x35a083){const _0x22934f=_0x2a33fe;_0x22934f['onStart']=_0x22934f['onStart']||function(){};if(!_0x22934f['port']||!_0x22934f['ip']){_0x35a083(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x22934f)),_0x22934f['onStart']=createSpawnedCb(_0x22934f['onStart'],_0x35a083);const _0x2fef42=getDistribution(),_0x4bc187=spawn('node',[_0x2fef42,'--config',global['distributi'+'on']['util']['serialize'](_0x22934f)],{'detached':!![],'stdio':'inherit'});_0x4bc187;},status['stop']=function(_0x21756f){_0x21756f=_0x21756f||function(){},_0x21756f(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](-0x12dd+-0x78d+0x1a6a);},module['exports']=status;
9
+ const log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':global['distributi'+'on']['util']['id']['getSID'](global['nodeConfig']),'nid':global['distributi'+'on']['util']['id']['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0x6711ec,_0x51806b){_0x51806b=_0x51806b||function(){};if(_0x6711ec in global['nodeConfig']){_0x51806b(null,global['nodeConfig'][_0x6711ec]);return;}if(_0x6711ec in global['moreStatus']){_0x51806b(null,global['moreStatus'][_0x6711ec]);return;}if(_0x6711ec==='heapTotal'){_0x51806b(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x6711ec==='heapUsed'){_0x51806b(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x51806b(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),{spawn,execSync}=require('child_proc'+'ess');function getDistribution(){let _0x231cc6=path['join'](process['cwd'](),'distributi'+'on.js');if(fs['existsSync'](_0x231cc6))return _0x231cc6;try{const _0x4e250b=execSync('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x231cc6=path['join'](_0x4e250b,'distributi'+'on.js');if(fs['existsSync'](_0x231cc6))return _0x231cc6;}catch(_0x26ada5){}_0x231cc6=path['join'](__dirname,'../../dist'+'ribution.j'+'s');if(fs['existsSync'](_0x231cc6))return _0x231cc6;return null;}status['spawn']=function(_0x578d8f,_0x29a494){const _0x5614ec=function(_0x2df1f6,_0x511829){const _0x4b2e72='\x0a\x20\x20\x20\x20\x20\x20let'+'\x20onStart\x20='+'\x20'+_0x2df1f6['toString']()+(';\x0a\x0a\x20\x20\x20\x20\x20\x20l'+'et\x20callbac'+'kRPC\x20=\x20')+global['distributi'+'on']['util']['wire']['createRPC'](global['distributi'+'on']['util']['wire']['toAsync'](_0x511829))['toString']()+(';\x0a\x0a\x20\x20\x20\x20\x20\x20t'+'ry\x20{\x0a\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20onSta'+'rt();\x0a\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20\x20call'+'backRPC(nu'+'ll,\x20global'+'.nodeConfi'+'g,\x20()\x20=>\x20{'+'});\x0a\x20\x20\x20\x20\x20\x20'+'}\x0a\x20\x20\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(e,\x20null,'+'\x20()\x20=>\x20{})'+';\x0a\x20\x20\x20\x20\x20\x20}\x0a'+'\x20\x20\x20\x20\x20\x20');return new Function(_0x4b2e72);},_0x237858=_0x578d8f;_0x237858['onStart']=_0x237858['onStart']||function(){};if(!_0x237858['port']||!_0x237858['ip']){_0x29a494(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x237858)),_0x237858['onStart']=_0x5614ec(_0x237858['onStart'],_0x29a494);const _0x44b8a7=getDistribution(),_0x1fcbfb=spawn('node',[_0x44b8a7,'--config',global['distributi'+'on']['util']['serialize'](_0x237858)],{'detached':!![],'stdio':'inherit'});_0x1fcbfb;},status['stop']=function(_0x582742){_0x582742=_0x582742||function(){},_0x582742(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](0xaa*0x1+0x794*-0x1+0x6ea);},module['exports']=status;
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,