Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / routing / server / applications / agent.js
index 0f8c905..865cda8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd09a=['routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger'];(function(_0x7506de,_0x329c12){var _0x3da148=function(_0x307df8){while(--_0x307df8){_0x7506de['push'](_0x7506de['shift']());}};_0x3da148(++_0x329c12);}(_0xd09a,0xd5));var _0xad09=function(_0x186ce4,_0x42427d){_0x186ce4=_0x186ce4-0x0;var _0x1fdd83=_0xd09a[_0x186ce4];return _0x1fdd83;};'use strict';var schema=require(_0xad09('0x0'));var _=require('lodash');var util=require(_0xad09('0x1'));var seqqueue=require(_0xad09('0x2'));var logger=require(_0xad09('0x3'))(_0xad09('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xad09('0x5')},'timeout':{'type':'number','message':_0xad09('0x6')}});function writeLog(_0x57a142,_0x2a0319,_0x2bd54b){return logger[_0xad09('0x7')](util[_0xad09('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x57a142,_0x2a0319['name'],_0x2bd54b));}function handleFindAgent(_0x4201dc){return function(_0xbc8dea){return _0xbc8dea[_0xad09('0x9')][_0xad09('0xa')]()===_0x4201dc[_0xad09('0xa')]();};}exports['consequence']=function(_0x20832a,_0x19dc8e,_0x2a8a13,_0x283b5b){return function(_0x2bf519){try{var _0x55c973={'name':_0x19dc8e[0x0],'timeout':_0x19dc8e[0x1]};var _0x211904=queue[_0xad09('0x0')](_0x55c973,{'typecast':!![]});if(_0x211904['length']){logger[_0xad09('0xb')](_0xad09('0xc'),_0x20832a,_[_0xad09('0xd')](_0x211904,_0xad09('0xe'))[_0xad09('0xf')](',\x20'));_0x2bf519[_0xad09('0x10')]();}else{var _0x49564c=_[_0xad09('0x11')](_0x2a8a13['agents'],handleFindAgent(_0x55c973[_0xad09('0x9')]));if(_0x49564c){var _0x250c42=(_0x55c973[_0xad09('0x12')]||0xa)*0x3e8;var _0x431f02,_0x364179;var _0x258575=seqqueue[_0xad09('0x13')](_0x250c42);_0x258575['id']=_0x20832a;_0x258575[_0xad09('0x14')]=_0x250c42;_0x258575[_0xad09('0x15')]=_0x283b5b['channel'];writeLog(_0x20832a,_0x49564c,util[_0xad09('0x8')](_0xad09('0x16'),_0x250c42));_0x2a8a13[_0xad09('0x17')][_0x20832a]['on'](_0xad09('0x18'),function(){logger[_0xad09('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x20832a);clearTimeout(_0x364179);_0x364179=undefined;_0x258575[_0xad09('0x19')]();if(_0x2a8a13['rules'][_0x20832a]){delete _0x2a8a13[_0xad09('0x17')][_0x20832a];}_0x2bf519[_0xad09('0x10')]();});_0x2a8a13[_0xad09('0x17')][_0x20832a]['on'](_0xad09('0x1a'),function(){if(_0x2a8a13['rules'][_0x20832a]){delete _0x2a8a13[_0xad09('0x17')][_0x20832a];}});_0x364179=setTimeout(function(){logger[_0xad09('0x7')](_0xad09('0x1b'),_0x20832a);clearTimeout(_0x364179);_0x258575[_0xad09('0x19')]();_0x2bf519[_0xad09('0x1c')]();},_0x250c42);strategy['agent'](_0x258575,_0x49564c,_0x2a8a13,_0x283b5b);}else{logger[_0xad09('0xb')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x20832a,_0x55c973['name']);_0x2bf519[_0xad09('0x10')]();}}}catch(_0x2cf878){console['log'](_0x2cf878);logger[_0xad09('0xb')](_0xad09('0x1d'),_0x20832a,_0x2cf878[_0xad09('0x1e')]);_0x2bf519[_0xad09('0x10')]();}};};
\ No newline at end of file
+var _0xdf87=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xdf87,0x174));var _0x7df8=function(_0x3f81f2,_0x2eb9ed){_0x3f81f2=_0x3f81f2-0x0;var _0x5ab8f6=_0xdf87[_0x3f81f2];return _0x5ab8f6;};'use strict';var schema=require(_0x7df8('0x0'));var _=require(_0x7df8('0x1'));var util=require(_0x7df8('0x2'));var seqqueue=require(_0x7df8('0x3'));var logger=require(_0x7df8('0x4'))(_0x7df8('0x5'));var strategy=require(_0x7df8('0x6'));var queue=schema({'name':{'type':_0x7df8('0x7'),'required':!![],'message':_0x7df8('0x8')},'timeout':{'type':'number','message':_0x7df8('0x9')}});function writeLog(_0x2f3a38,_0x5a0e92,_0x8aa5f1){return logger[_0x7df8('0xa')](util[_0x7df8('0xb')](_0x7df8('0xc'),_0x2f3a38,_0x5a0e92['name'],_0x8aa5f1));}function handleFindAgent(_0x385fba){return function(_0x3951a7){return _0x3951a7['name'][_0x7df8('0xd')]()===_0x385fba[_0x7df8('0xd')]();};}exports['consequence']=function(_0x1cc4f4,_0x45c4b8,_0x6a60d5,_0x497fd9){return function(_0x430a65){try{var _0x549f1a={'name':_0x45c4b8[0x0],'timeout':_0x45c4b8[0x1]};var _0x5b8d72=queue[_0x7df8('0x0')](_0x549f1a,{'typecast':!![]});if(_0x5b8d72[_0x7df8('0xe')]){logger[_0x7df8('0xf')](_0x7df8('0x10'),_0x1cc4f4,_[_0x7df8('0x11')](_0x5b8d72,_0x7df8('0x12'))[_0x7df8('0x13')](',\x20'));_0x430a65[_0x7df8('0x14')]();}else{var _0x1cd60e=_[_0x7df8('0x15')](_0x6a60d5[_0x7df8('0x16')],handleFindAgent(_0x549f1a[_0x7df8('0x17')]));if(_0x1cd60e){var _0x40c698=(_0x549f1a['timeout']||0xa)*0x3e8;var _0x3844b2,_0xf867ef;var _0x153124=seqqueue[_0x7df8('0x18')](_0x40c698);_0x153124['id']=_0x1cc4f4;_0x153124[_0x7df8('0x19')]=_0x40c698;_0x153124['channel']=_0x497fd9[_0x7df8('0x1a')];writeLog(_0x1cc4f4,_0x1cd60e,util[_0x7df8('0xb')](_0x7df8('0x1b'),_0x40c698));_0x6a60d5['rules'][_0x1cc4f4]['on']('end',function(){logger[_0x7df8('0xa')](_0x7df8('0x1c'),_0x1cc4f4);clearTimeout(_0xf867ef);_0xf867ef=undefined;_0x153124['close']();if(_0x6a60d5[_0x7df8('0x1d')][_0x1cc4f4]){delete _0x6a60d5[_0x7df8('0x1d')][_0x1cc4f4];}_0x430a65[_0x7df8('0x14')]();});_0x6a60d5[_0x7df8('0x1d')][_0x1cc4f4]['on'](_0x7df8('0x1e'),function(){if(_0x6a60d5['rules'][_0x1cc4f4]){delete _0x6a60d5[_0x7df8('0x1d')][_0x1cc4f4];}});_0xf867ef=setTimeout(function(){logger[_0x7df8('0xa')](_0x7df8('0x1f'),_0x1cc4f4);clearTimeout(_0xf867ef);_0x153124[_0x7df8('0x20')]();_0x430a65[_0x7df8('0x21')]();},_0x40c698);strategy['agent'](_0x153124,_0x1cd60e,_0x6a60d5,_0x497fd9);}else{logger[_0x7df8('0xf')](_0x7df8('0x22'),_0x1cc4f4,_0x549f1a[_0x7df8('0x17')]);_0x430a65[_0x7df8('0x14')]();}}}catch(_0x367a05){console[_0x7df8('0x23')](_0x367a05);logger[_0x7df8('0xf')](_0x7df8('0x24'),_0x1cc4f4,_0x367a05[_0x7df8('0x25')]);_0x430a65[_0x7df8('0x14')]();}};};
\ No newline at end of file