@brown-ds/distribution 0.0.47 → 0.0.48

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
- function comm(_0x5a736b){const _0x1f8e14={};_0x1f8e14['gid']=_0x5a736b['gid']||'global';function _0x428ebf(_0xac1e24,_0x170d5d,_0x3f9384){global['distributi'+'on']['local']['groups']['get'](_0x1f8e14['gid'],(_0x51053e,_0xd3f57c)=>{const _0x3d6eb0=Object['keys'](_0xd3f57c)['length'];if(_0x3d6eb0===-0xf6*0xc+-0x2476+0x2ffe){_0x3f9384(new Error('No\x20nodes\x20f'+'ound'));return;}let _0x11c100=0x1ff0+-0x201a+-0x7*-0x6;const _0x21b9eb={},_0x123cab={};for(const _0x2d8d17 of Object['keys'](_0xd3f57c)){const _0x197072=_0xd3f57c[_0x2d8d17],_0x3e3388={'node':{'ip':_0x197072['ip'],'port':_0x197072['port']},'service':_0x170d5d['service'],'method':_0x170d5d['method'],'group':_0x170d5d['group']||'local'};global['distributi'+'on']['local']['comm']['send'](_0xac1e24,_0x3e3388,(_0x2b4d5f,_0x47e3c1)=>{_0x2b4d5f?_0x123cab[_0x2d8d17]=_0x2b4d5f:_0x21b9eb[_0x2d8d17]=_0x47e3c1,_0x11c100+=0x1a6e+0x19f2+-0x1175*0x3,_0x11c100===_0x3d6eb0&&_0x3f9384(_0x123cab,_0x21b9eb);});}});}return{'send':_0x428ebf};};module['exports']=comm;
9
+ function comm(_0x3ff307){const _0x27d376={};_0x27d376['gid']=_0x3ff307['gid']||'global';function _0x3a6af3(_0x2830e3,_0x55cfbd,_0xeaadfb){global['distributi'+'on']['local']['groups']['get'](_0x27d376['gid'],(_0x1ac991,_0x38d838)=>{const _0x372909=Object['keys'](_0x38d838)['length'];if(_0x372909===0x8f5*-0x2+0x1d5f+-0xb75){_0xeaadfb(new Error('No\x20nodes\x20f'+'ound'));return;}let _0xdc7351=0x29c*-0x7+-0x1082+0x22c6;const _0x1b694e={},_0x57635d={};for(const _0x395b8c of Object['keys'](_0x38d838)){const _0x931efa=_0x38d838[_0x395b8c],_0x1502ce={'node':{'ip':_0x931efa['ip'],'port':_0x931efa['port']},'service':_0x55cfbd['service'],'method':_0x55cfbd['method'],'gid':_0x55cfbd['gid']||'local'};global['distributi'+'on']['local']['comm']['send'](_0x2830e3,_0x1502ce,(_0x5e82ce,_0x24e7c4)=>{_0x5e82ce?_0x57635d[_0x395b8c]=_0x5e82ce:_0x1b694e[_0x395b8c]=_0x24e7c4,_0xdc7351+=0x1*-0xf63+0x61*-0x19+-0x43*-0x5f,_0xdc7351===_0x372909&&_0xeaadfb(_0x57635d,_0x1b694e);});}});}return{'send':_0x3a6af3};};module['exports']=comm;
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 distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0xec35b){const _0x19e1d6={'gid':_0xec35b['gid']||'global'};function _0x3ef6e4(_0x11964b,_0xd1d4ed){const _0x5aef47=id['getSID'](_0x11964b),_0x11c35d={'mapper':_0x11964b['map'],'reducer':_0x11964b['reduce'],'map':function(_0x365602,_0x38c1d1,_0x34231d,_0x1bec09){if(_0x365602['length']==-0xa59*-0x3+0xbad*0x3+-0x4212)_0x1bec09(null,{});else{const _0x536d19=[];let _0x11e731=-0x989+-0x102*0x1f+0x28c7;_0x365602['forEach'](_0x1b59fc=>{distribution[_0x38c1d1]['store']['get'](_0x1b59fc,(_0x401c24,_0x352aaa)=>{_0x11e731++;const _0xa6772e=this['mapper'](_0x1b59fc,_0x352aaa);Array['isArray'](_0xa6772e)?_0x536d19['push'](..._0xa6772e):_0x536d19['push'](_0xa6772e),_0x11e731==_0x365602['length']&&distribution['local']['store']['put'](_0x536d19,_0x34231d+'_map',(_0x19471e,_0x12dd47)=>{_0x1bec09(_0x19471e,_0x536d19);});});});}},'shuffle':function(_0x58cc9b,_0x5cb604,_0x19a6d3){distribution['local']['store']['get'](_0x5cb604+'_map',(_0x4b4df1,_0x2d5d19)=>{if(!_0x4b4df1){let _0x4a63d9=0xe7f+0x43+-0xec2;_0x2d5d19['forEach'](_0x9c8ab3=>{const [_0x266b04]=Object['keys'](_0x9c8ab3);distribution[_0x58cc9b]['mem']['put'](_0x9c8ab3[_0x266b04],{'key':_0x266b04,'action':'append'},(_0x1e9e4b,_0x5c6918)=>{_0x4a63d9++,_0x4a63d9==_0x2d5d19['length']&&_0x19a6d3(null,_0x2d5d19);});});}else _0x19a6d3(_0x4b4df1,{});});},'reduce':function(_0x24052a,_0x3e4b4a,_0x2a0942){distribution['local']['mem']['get']({'key':null,'gid':_0x24052a},(_0x3d524c,_0x5675e9)=>{let _0x44907a=[],_0x5a5867=-0x1aa6+-0x22d8+0x1*0x3d7e;_0x5675e9['length']==0x243c+0x6*-0x3af+-0xe22&&_0x2a0942(null,null),_0x5675e9['forEach'](_0x2b7979=>distribution['local']['mem']['get']({'key':_0x2b7979,'gid':_0x24052a},(_0x5c5fb9,_0x3c0e8c)=>{const _0x2391e0=this['reducer'](_0x2b7979,_0x3c0e8c);_0x44907a=_0x44907a['concat'](_0x2391e0),_0x5a5867++,_0x5a5867==_0x5675e9['length']&&_0x2a0942(null,_0x44907a);}));});}},_0x3e724c=function(_0x46cbac,_0x31ae55){const _0x1b4e2e={};return Object['keys'](_0x31ae55)['forEach'](_0x3f03f9=>{_0x1b4e2e[_0x3f03f9]=[];}),_0x46cbac['forEach'](_0x11c1dc=>{const _0x487702=id['getID'](_0x11c1dc),_0x11a4e3=id['naiveHash'](_0x487702,Object['keys'](_0x31ae55));_0x1b4e2e[_0x11a4e3]['push'](_0x11c1dc);}),_0x1b4e2e;};distribution[_0x19e1d6['gid']]['routes']['put'](_0x11c35d,'mr-'+_0x5aef47,(_0x41bff3,_0x53d96f)=>{distribution['local']['groups']['get'](_0x19e1d6['gid'],(_0x3620bf,_0x672f74)=>{const _0x56ea04=_0x3e724c(_0x11964b['keys'],_0x672f74);let _0xe09642=0xc4*-0x20+0xc63*-0x1+-0x85*-0x47;const _0x3ce435=Object['keys'](_0x672f74)['length'],_0x5059ac={'service':'mr-'+_0x5aef47,'method':'map'};for(const _0x470607 in _0x672f74){_0x5059ac['node']=_0x672f74[_0x470607];const _0x802d07=[_0x56ea04[_0x470607],_0x19e1d6['gid'],_0x5aef47];distribution['local']['comm']['send'](_0x802d07,_0x5059ac,(_0x2576cb,_0x2c21d6)=>{++_0xe09642;if(_0xe09642==_0x3ce435){const _0x3a28f2={'service':'mr-'+_0x5aef47,'method':'shuffle'};distribution[_0x19e1d6['gid']]['comm']['send']([_0x19e1d6['gid'],_0x5aef47],_0x3a28f2,(_0x2ec81f,_0x52ccdb)=>{const _0x19aa91={'service':'mr-'+_0x5aef47,'method':'reduce'};distribution[_0x19e1d6['gid']]['comm']['send']([_0x19e1d6['gid'],_0x5aef47],_0x19aa91,(_0x476341,_0x221f74)=>{let _0x58c8fd=[];for(const _0x30cf48 of Object['values'](_0x221f74)){_0x30cf48!==null&&(_0x58c8fd=_0x58c8fd['concat'](_0x30cf48));}_0xd1d4ed(null,_0x58c8fd);return;distribution[_0x19e1d6['gid']]['routes']['rem']('mr-'+_0x5aef47,(_0x433e5b,_0x542a20)=>{});});});}});}});});}return{'exec':_0x3ef6e4};};module['exports']=mr;
9
+ const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x245017){const _0x4221e2={'gid':_0x245017['gid']||'global'};function _0x3b541e(_0x278b20,_0x16df72){const _0x5aece6=id['getSID'](_0x278b20),_0xca6e4f={'mapper':_0x278b20['map'],'reducer':_0x278b20['reduce'],'map':function(_0x4d9914,_0x157672,_0x2a0cf2,_0x42c0f2){if(_0x4d9914['length']==-0x9*0x20d+0x1be5+-0x970*0x1)_0x42c0f2(null,{});else{const _0x5f084c=[];let _0x373feb=-0x1cb5+0x51c*0x2+0x1*0x127d;_0x4d9914['forEach'](_0x2d0951=>{distribution[_0x157672]['store']['get'](_0x2d0951,(_0x4a1db7,_0x4efd72)=>{_0x373feb++;const _0x37c698=this['mapper'](_0x2d0951,_0x4efd72);Array['isArray'](_0x37c698)?_0x5f084c['push'](..._0x37c698):_0x5f084c['push'](_0x37c698),_0x373feb==_0x4d9914['length']&&distribution['local']['store']['put'](_0x5f084c,_0x2a0cf2+'_map',(_0x2aff0e,_0x618408)=>{_0x42c0f2(_0x2aff0e,_0x5f084c);});});});}},'shuffle':function(_0x5cf805,_0x23c4b8,_0x356977){distribution['local']['store']['get'](_0x23c4b8+'_map',(_0x12610b,_0x1cd31f)=>{if(!_0x12610b){let _0x5dbb74=-0x78a+0x13da+-0xc50;_0x1cd31f['forEach'](_0x4339de=>{const [_0x276299]=Object['keys'](_0x4339de);distribution[_0x5cf805]['mem']['put'](_0x4339de[_0x276299],{'key':_0x276299,'action':'append'},(_0x4b06b9,_0x502649)=>{_0x5dbb74++,_0x5dbb74==_0x1cd31f['length']&&_0x356977(null,_0x1cd31f);});});}else _0x356977(_0x12610b,{});});},'reduce':function(_0x4389bd,_0x3a0726,_0x105978){distribution['local']['mem']['get']({'key':null,'gid':_0x4389bd},(_0x18a902,_0x2721c8)=>{let _0x266ba4=[],_0xefbd34=0xd3d*0x1+-0x14d+-0xbf0;_0x2721c8['length']==-0xcde+0x182d*0x1+-0xb4f&&_0x105978(null,null),_0x2721c8['forEach'](_0x582bcd=>distribution['local']['mem']['get']({'key':_0x582bcd,'gid':_0x4389bd},(_0x1c1dc3,_0x53c232)=>{const _0x3956b4=this['reducer'](_0x582bcd,_0x53c232);_0x266ba4=_0x266ba4['concat'](_0x3956b4),_0xefbd34++,_0xefbd34==_0x2721c8['length']&&_0x105978(null,_0x266ba4);}));});}},_0x20af29=function(_0x5636e8,_0x44af7c){const _0x2b624a={};return Object['keys'](_0x44af7c)['forEach'](_0x4aba1d=>{_0x2b624a[_0x4aba1d]=[];}),_0x5636e8['forEach'](_0x331451=>{const _0x48021b=id['getID'](_0x331451),_0x28c562=id['naiveHash'](_0x48021b,Object['keys'](_0x44af7c));_0x2b624a[_0x28c562]['push'](_0x331451);}),_0x2b624a;};distribution[_0x4221e2['gid']]['routes']['put'](_0xca6e4f,'mr-'+_0x5aece6,(_0x2556fa,_0x21e5fb)=>{distribution['local']['groups']['get'](_0x4221e2['gid'],(_0x46da67,_0x1c3649)=>{const _0x2160d4=_0x20af29(_0x278b20['keys'],_0x1c3649);let _0x59ad89=0x1*-0x4a7+-0x2130+0xc9d*0x3;const _0x4c34f3=Object['keys'](_0x1c3649)['length'],_0x1f72c4={'service':'mr-'+_0x5aece6,'method':'map'};for(const _0x54d376 in _0x1c3649){_0x1f72c4['node']=_0x1c3649[_0x54d376];const _0x465ec9=[_0x2160d4[_0x54d376],_0x4221e2['gid'],_0x5aece6];distribution['local']['comm']['send'](_0x465ec9,_0x1f72c4,(_0x27f5f2,_0x427568)=>{++_0x59ad89;if(_0x59ad89==_0x4c34f3){const _0x58cdd5={'service':'mr-'+_0x5aece6,'method':'shuffle'};distribution[_0x4221e2['gid']]['comm']['send']([_0x4221e2['gid'],_0x5aece6],_0x58cdd5,(_0x797bb2,_0x28587c)=>{const _0x304270={'service':'mr-'+_0x5aece6,'method':'reduce'};distribution[_0x4221e2['gid']]['comm']['send']([_0x4221e2['gid'],_0x5aece6],_0x304270,(_0x5a9688,_0x12861c)=>{let _0x4420a0=[];for(const _0x390fe8 of Object['values'](_0x12861c)){_0x390fe8!==null&&(_0x4420a0=_0x4420a0['concat'](_0x390fe8));}_0x16df72(null,_0x4420a0);return;distribution[_0x4221e2['gid']]['routes']['rem']('mr-'+_0x5aece6,(_0x14297a,_0xc71d57)=>{});});});}});}});});}return{'exec':_0x3b541e};};module['exports']=mr;
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 http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');function send(_0x5a65c8,_0x48c395,_0x7b40bc){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x5a65c8)+'to\x20'+_0x48c395['service']+':'+_0x48c395['method']+'\x20on\x20'+_0x48c395['node']['ip']+':'+_0x48c395['node']['port']);if(!_0x5a65c8 instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0xdd5700=_0x48c395['node'],_0x20bf2d=_0x48c395['service'],_0x687a05=_0x48c395['method'],_0x15198f=_0x48c395['group']||'local',_0x4c5014=serialization['serialize'](_0x5a65c8),_0x4c224b={'hostname':_0xdd5700['ip'],'port':_0xdd5700['port'],'path':'/'+_0x15198f+'/'+_0x20bf2d+'/'+_0x687a05,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x4c5014)}},_0x5de4a2=http['request'](_0x4c224b,_0x37333c=>{let _0x1e921c='';_0x37333c['on']('data',function(_0x561dd4){_0x1e921c+=_0x561dd4;}),_0x37333c['on']('end',function(){_0x7b40bc&&_0x7b40bc(...serialization['deserializ'+'e'](_0x1e921c));}),_0x37333c['on']('error',function(_0x43b47a){_0x7b40bc&&_0x7b40bc(new Error('Error\x20on\x20r'+'esponse'));});});_0x5de4a2['on']('error',function(_0x2264f4){_0x7b40bc&&_0x7b40bc(new Error(_0x2264f4));}),_0x5de4a2['write'](_0x4c5014),_0x5de4a2['end']();}module['exports']={'send':send};
9
+ const http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');function send(_0x300bcb,_0x3023ca,_0x34e3b3){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x300bcb)+'to\x20'+_0x3023ca['service']+':'+_0x3023ca['method']+'\x20on\x20'+_0x3023ca['node']['ip']+':'+_0x3023ca['node']['port']);if(!_0x300bcb instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0x35595c=_0x3023ca['node'],_0x184741=_0x3023ca['service'],_0x4a4e97=_0x3023ca['method'],_0x4e0578=_0x3023ca['gid']||'local',_0x5cfefb=serialization['serialize'](_0x300bcb),_0x20ba86={'hostname':_0x35595c['ip'],'port':_0x35595c['port'],'path':'/'+_0x4e0578+'/'+_0x184741+'/'+_0x4a4e97,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x5cfefb)}},_0x4aedd9=http['request'](_0x20ba86,_0x42eaf5=>{let _0x367027='';_0x42eaf5['on']('data',function(_0x5ca18f){_0x367027+=_0x5ca18f;}),_0x42eaf5['on']('end',function(){_0x34e3b3&&_0x34e3b3(...serialization['deserializ'+'e'](_0x367027));}),_0x42eaf5['on']('error',function(_0x190227){_0x34e3b3&&_0x34e3b3(new Error('Error\x20on\x20r'+'esponse'));});});_0x4aedd9['on']('error',function(_0x33f3a1){_0x34e3b3&&_0x34e3b3(new Error(_0x33f3a1));}),_0x4aedd9['write'](_0x5cfefb),_0x4aedd9['end']();}module['exports']={'send':send};
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 http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x1d8398){if(_0x1d8398['length']===0x3*-0x761+0x110+0x1*0x1513)return new Error('No\x20body');try{_0x1d8398=JSON['parse'](_0x1d8398);}catch(_0x2d3083){return _0x2d3083;}return undefined;}function endRequest(_0x11432d,_0x438dcc){_0x11432d['end'](serialization['serialize']([_0x438dcc]));}const start=function(_0x27f278){const _0x15ef75=http['createServ'+'er']((_0x5bde2a,_0x31a145)=>{if(_0x5bde2a['method']!=='PUT'){_0x31a145['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x56cb53=url['parse'](_0x5bde2a['url'])['pathname'],[,_0x4338f4,_0x4f6aef,_0x118ae6]=_0x56cb53['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x4338f4+'\x20'+_0x4f6aef+':'+_0x118ae6+'\x20from\x20'+_0x5bde2a['connection']['remoteAddr'+'ess']);let _0x26d95e=[];_0x5bde2a['on']('data',_0x7aa3ca=>{_0x26d95e['push'](_0x7aa3ca);}),_0x5bde2a['on']('end',()=>{_0x26d95e=Buffer['concat'](_0x26d95e)['toString']();let _0x207b74;if(_0x207b74=isValidBody(_0x26d95e)){endRequest(_0x31a145,_0x207b74);return;}_0x26d95e=JSON['parse'](_0x26d95e),_0x26d95e=serialization['deserializ'+'e'](_0x26d95e);const _0x315c69=_0x26d95e;!Array['isArray'](_0x315c69)&&endRequest(_0x31a145,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x315c69));const _0x2b0671=_0x4f6aef;global['distributi'+'on']['local']['routes']['get']({'serviceName':_0x2b0671,'gid':_0x4338f4},(_0x3988f3,_0x11edad)=>{const _0x7d459d=(_0x12eaa5,_0x31d838)=>{_0x31a145['end'](serialization['serialize']([_0x12eaa5,_0x31d838]));};if(_0x3988f3){_0x7d459d(_0x3988f3);return;}if(!_0x11edad[_0x118ae6]){_0x7d459d(new Error('Method\x20'+_0x118ae6+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x2b0671));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x2b0671+':'+_0x118ae6+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x315c69));_0x315c69['length']===-0x1037*0x1+0xa06*-0x3+0x942*0x5&&_0x11edad[_0x118ae6]['length']===0x1a3c+0x17*-0x13+0xc42*-0x2&&_0x315c69['push'](undefined);try{_0x11edad[_0x118ae6](..._0x315c69,_0x7d459d);}catch(_0x2b7917){_0x7d459d(_0x2b7917);}});});});_0x15ef75['listen'](global['nodeConfig']['port'],global['nodeConfig']['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+global['nodeConfig']['ip']+':'+global['nodeConfig']['port']+'/'),global['distributi'+'on']['node']['server']=_0x15ef75,_0x27f278(_0x15ef75);}),_0x15ef75['on']('error',_0x21a19b=>{log('Server\x20err'+'or:\x20'+_0x21a19b);throw _0x21a19b;});};module['exports']={'start':start};
9
+ const http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x377981){if(_0x377981['length']===-0x1814+-0x1cf9*0x1+0x350d)return new Error('No\x20body');try{_0x377981=JSON['parse'](_0x377981);}catch(_0x185f27){return _0x185f27;}return undefined;}function endRequest(_0x540e16,_0x3d1ccb){_0x540e16['end'](serialization['serialize']([_0x3d1ccb]));}const start=function(_0x966886){const _0x3a6518=http['createServ'+'er']((_0x81d7f9,_0x24b09d)=>{if(_0x81d7f9['method']!=='PUT'){_0x24b09d['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x25b575=url['parse'](_0x81d7f9['url'])['pathname'],[,_0x10d46f,_0x549703,_0x7b93c4]=_0x25b575['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x10d46f+'\x20'+_0x549703+':'+_0x7b93c4+'\x20from\x20'+_0x81d7f9['connection']['remoteAddr'+'ess']);let _0x5b05d9=[];_0x81d7f9['on']('data',_0x259bfc=>{_0x5b05d9['push'](_0x259bfc);}),_0x81d7f9['on']('end',()=>{_0x5b05d9=Buffer['concat'](_0x5b05d9)['toString']();let _0x3c4071;if(_0x3c4071=isValidBody(_0x5b05d9)){endRequest(_0x24b09d,_0x3c4071);return;}_0x5b05d9=JSON['parse'](_0x5b05d9),_0x5b05d9=serialization['deserializ'+'e'](_0x5b05d9);const _0xeab15c=_0x5b05d9;!Array['isArray'](_0xeab15c)&&endRequest(_0x24b09d,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0xeab15c));const _0x336473=_0x549703;global['distributi'+'on']['local']['routes']['get']({'service':_0x549703,'gid':_0x10d46f},(_0x53dc03,_0x1c3871)=>{const _0x9e7383=(_0x365a8e,_0x1d3e09)=>{_0x24b09d['end'](serialization['serialize']([_0x365a8e,_0x1d3e09]));};if(_0x53dc03){_0x9e7383(_0x53dc03);return;}if(!_0x1c3871[_0x7b93c4]){_0x9e7383(new Error('Method\x20'+_0x7b93c4+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x336473));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x336473+':'+_0x7b93c4+('\x20with\x20args'+':\x20')+JSON['stringify'](_0xeab15c));_0xeab15c['length']===-0x1ecd+-0x33*0x95+0x3c7d&&_0x1c3871[_0x7b93c4]['length']===0x43f*0x1+-0x9*0x24+-0x28*0x13&&_0xeab15c['push'](undefined);try{_0x1c3871[_0x7b93c4](..._0xeab15c,_0x9e7383);}catch(_0xebf001){_0x9e7383(_0xebf001);}});});});_0x3a6518['listen'](global['nodeConfig']['port'],global['nodeConfig']['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+global['nodeConfig']['ip']+':'+global['nodeConfig']['port']+'/'),global['distributi'+'on']['node']['server']=_0x3a6518,_0x966886(_0x3a6518);}),_0x3a6518['on']('error',_0x51f1ef=>{log('Server\x20err'+'or:\x20'+_0x51f1ef);throw _0x51f1ef;});};module['exports']={'start':start};
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'),routesStore=new Map();function get(_0xe9d645,_0x566453){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0xe9d645));if(!_0x566453)return;typeof _0xe9d645==='string'&&(_0xe9d645={'serviceName':_0xe9d645});const _0x21a725=_0xe9d645['serviceNam'+'e'],_0x13c2a0=_0xe9d645['gid'];if(_0x13c2a0&&_0x13c2a0!=='local'){log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x21a725);const _0x5d8a76=global['distributi'+'on'][_0x13c2a0][_0x21a725];_0x566453(null,_0x5d8a76);}else{if(_0x21a725 in routesStore){const _0x288455=routesStore[_0x21a725];log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x21a725),_0x566453(null,_0x288455);}else{const _0x5daf3e=global['toLocal']['get'](_0x21a725);_0x5daf3e?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x21a725),_0x566453(null,{'call':_0x5daf3e})):_0x566453(new Error('Service\x20'+_0x21a725+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x571665,_0x4f08c8,_0x3c95de){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x4f08c8+'\x20'+JSON['stringify'](_0x571665)),routesStore[_0x4f08c8]=_0x571665;_0x3c95de&&_0x3c95de(null,_0x4f08c8);;}function rem(_0x4bdabf,_0x1c74fd){const _0x1ccdcc=routesStore[_0x4bdabf];delete routesStore[_0x4bdabf],_0x1c74fd(null,_0x1ccdcc);};module['exports']={'get':get,'put':put,'rem':rem};
9
+ const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0xd7907f,_0xed0098){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0xd7907f));if(!_0xed0098)return;typeof _0xd7907f==='string'&&(_0xd7907f={'service':_0xd7907f});const _0x3ba868=_0xd7907f['service'],_0x5195df=_0xd7907f['gid'];if(_0x5195df&&_0x5195df!=='local')log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x3ba868),_0xed0098(null,global['distributi'+'on'][_0x5195df][_0x3ba868]);else{if(_0x3ba868 in routesStore)log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x3ba868),_0xed0098(null,routesStore[_0x3ba868]);else{const _0x32adc9=global['toLocal']['get'](_0x3ba868);_0x32adc9?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x3ba868),_0xed0098(null,{'call':_0x32adc9})):_0xed0098(new Error('Service\x20'+_0x3ba868+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x1f51cd,_0x4a907d,_0x41a465){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x4a907d+'\x20'+JSON['stringify'](_0x1f51cd)),routesStore[_0x4a907d]=_0x1f51cd;_0x41a465&&_0x41a465(null,_0x4a907d);;}function rem(_0x451b3f,_0x3f58ab){const _0x5b8abb=routesStore[_0x451b3f];delete routesStore[_0x451b3f],_0x3f58ab(null,_0x5b8abb);};module['exports']={'get':get,'put':put,'rem':rem};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
- "useLibrary": false,
6
+ "useLibrary": true,
7
7
  "directories": {
8
8
  "test": "test"
9
9
  },