Built motion from commit (unavailable).|2.2.1
[motion2.git] / server / services / routing / server / applications / agent.js
index 194a87e..4ac6dd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcccf=['seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util'];(function(_0x238d98,_0x5c0282){var _0x5a154f=function(_0x4359a2){while(--_0x4359a2){_0x238d98['push'](_0x238d98['shift']());}};_0x5a154f(++_0x5c0282);}(_0xcccf,0x1ba));var _0xfccc=function(_0x2a77e3,_0x40ef74){_0x2a77e3=_0x2a77e3-0x0;var _0x17c283=_0xcccf[_0x2a77e3];return _0x17c283;};'use strict';var schema=require('validate');var _=require(_0xfccc('0x0'));var util=require(_0xfccc('0x1'));var seqqueue=require(_0xfccc('0x2'));var logger=require(_0xfccc('0x3'))('routing');var strategy=require(_0xfccc('0x4'));var queue=schema({'name':{'type':_0xfccc('0x5'),'required':!![],'message':_0xfccc('0x6')},'timeout':{'type':_0xfccc('0x7'),'message':_0xfccc('0x8')}});function writeLog(_0x21e13b,_0x136030,_0x2a8892){return logger['info'](util[_0xfccc('0x9')](_0xfccc('0xa'),_0x21e13b,_0x136030[_0xfccc('0xb')],_0x2a8892));}function handleFindAgent(_0x444a3f){return function(_0x4bd8d3){return _0x4bd8d3[_0xfccc('0xb')][_0xfccc('0xc')]()===_0x444a3f[_0xfccc('0xc')]();};}exports[_0xfccc('0xd')]=function(_0x3588cf,_0x44b3ed,_0x5cf0ad,_0x386d39){return function(_0x2f89d2){try{var _0xe28187={'name':_0x44b3ed[0x0],'timeout':_0x44b3ed[0x1]};var _0x3fc29c=queue[_0xfccc('0xe')](_0xe28187,{'typecast':!![]});if(_0x3fc29c[_0xfccc('0xf')]){logger[_0xfccc('0x10')](_0xfccc('0x11'),_0x3588cf,_['map'](_0x3fc29c,_0xfccc('0x12'))[_0xfccc('0x13')](',\x20'));_0x2f89d2[_0xfccc('0x14')]();}else{var _0x4099bf=_[_0xfccc('0x15')](_0x5cf0ad[_0xfccc('0x16')],handleFindAgent(_0xe28187[_0xfccc('0xb')]));if(_0x4099bf){var _0x1e9b8c=(_0xe28187[_0xfccc('0x17')]||0xa)*0x3e8;var _0x3ddb5a,_0xb6ce30;var _0x26db1c=seqqueue[_0xfccc('0x18')](_0x1e9b8c);_0x26db1c['id']=_0x3588cf;_0x26db1c[_0xfccc('0x19')]=_0x1e9b8c;_0x26db1c[_0xfccc('0x1a')]=_0x386d39[_0xfccc('0x1a')];writeLog(_0x3588cf,_0x4099bf,util[_0xfccc('0x9')]('START:%s',_0x1e9b8c));_0x5cf0ad[_0xfccc('0x1b')][_0x3588cf]['on'](_0xfccc('0x1c'),function(){_0x26db1c['close']();clearTimeout(_0xb6ce30);_0xb6ce30=undefined;if(_0x5cf0ad[_0xfccc('0x1b')][_0x3588cf]){delete _0x5cf0ad[_0xfccc('0x1b')][_0x3588cf];}logger[_0xfccc('0x1d')](_0xfccc('0x1e'),_0x3588cf);_0x2f89d2['stop']();});_0xb6ce30=setTimeout(function(){clearTimeout(_0xb6ce30);_0x26db1c['close']();logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x3588cf);_0x2f89d2[_0xfccc('0x1f')]();},_0x1e9b8c);strategy[_0xfccc('0x20')](_0x26db1c,_0x4099bf,_0x5cf0ad,_0x386d39);}else{logger[_0xfccc('0x10')](_0xfccc('0x21'),_0x3588cf,_0xe28187[_0xfccc('0xb')]);_0x2f89d2[_0xfccc('0x14')]();}}}catch(_0x3bae0d){console[_0xfccc('0x22')](_0x3bae0d);logger[_0xfccc('0x10')](_0xfccc('0x23'),_0x3588cf,_0x3bae0d[_0xfccc('0x24')]);_0x2f89d2['stop']();}};};
\ No newline at end of file
+var _0x189a=['length','error','[%s][AGENT]\x20%s','map','message','stop','find','createQueue','atimeout','channel','START:%s','rules','end','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x189a,0xbc));var _0xa189=function(_0x3d1cbd,_0x54f2b2){_0x3d1cbd=_0x3d1cbd-0x0;var _0x215305=_0x189a[_0x3d1cbd];return _0x215305;};'use strict';var schema=require(_0xa189('0x0'));var _=require(_0xa189('0x1'));var util=require(_0xa189('0x2'));var seqqueue=require(_0xa189('0x3'));var logger=require(_0xa189('0x4'))(_0xa189('0x5'));var strategy=require(_0xa189('0x6'));var queue=schema({'name':{'type':_0xa189('0x7'),'required':!![],'message':_0xa189('0x8')},'timeout':{'type':_0xa189('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x80a417,_0x68d9ea,_0x1c3181){return logger[_0xa189('0xa')](util[_0xa189('0xb')](_0xa189('0xc'),_0x80a417,_0x68d9ea['name'],_0x1c3181));}function handleFindAgent(_0x3ceda9){return function(_0x4ae113){return _0x4ae113[_0xa189('0xd')][_0xa189('0xe')]()===_0x3ceda9[_0xa189('0xe')]();};}exports[_0xa189('0xf')]=function(_0x61a16e,_0x59c3bc,_0x22988f,_0x5dfd77){return function(_0x3c2ced){try{var _0x228a24={'name':_0x59c3bc[0x0],'timeout':_0x59c3bc[0x1]};var _0x90014d=queue[_0xa189('0x0')](_0x228a24,{'typecast':!![]});if(_0x90014d[_0xa189('0x10')]){logger[_0xa189('0x11')](_0xa189('0x12'),_0x61a16e,_[_0xa189('0x13')](_0x90014d,_0xa189('0x14'))['join'](',\x20'));_0x3c2ced[_0xa189('0x15')]();}else{var _0x4ce057=_[_0xa189('0x16')](_0x22988f['agents'],handleFindAgent(_0x228a24[_0xa189('0xd')]));if(_0x4ce057){var _0x5ef083=(_0x228a24['timeout']||0xa)*0x3e8;var _0x3a86e0,_0x45cb42;var _0x39225a=seqqueue[_0xa189('0x17')](_0x5ef083);_0x39225a['id']=_0x61a16e;_0x39225a[_0xa189('0x18')]=_0x5ef083;_0x39225a[_0xa189('0x19')]=_0x5dfd77[_0xa189('0x19')];writeLog(_0x61a16e,_0x4ce057,util['format'](_0xa189('0x1a'),_0x5ef083));_0x22988f[_0xa189('0x1b')][_0x61a16e]['on'](_0xa189('0x1c'),function(){_0x39225a[_0xa189('0x1d')]();clearTimeout(_0x45cb42);_0x45cb42=undefined;if(_0x22988f['rules'][_0x61a16e]){delete _0x22988f[_0xa189('0x1b')][_0x61a16e];}logger[_0xa189('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x61a16e);_0x3c2ced[_0xa189('0x15')]();});_0x45cb42=setTimeout(function(){clearTimeout(_0x45cb42);_0x39225a['close']();logger[_0xa189('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x61a16e);_0x3c2ced[_0xa189('0x1e')]();},_0x5ef083);strategy[_0xa189('0x1f')](_0x39225a,_0x4ce057,_0x22988f,_0x5dfd77);}else{logger[_0xa189('0x11')](_0xa189('0x20'),_0x61a16e,_0x228a24['name']);_0x3c2ced['stop']();}}}catch(_0x5b94d0){console[_0xa189('0x21')](_0x5b94d0);logger[_0xa189('0x11')]('[%s][QUEUE]\x20%s',_0x61a16e,_0x5b94d0['stack']);_0x3c2ced[_0xa189('0x15')]();}};};
\ No newline at end of file