UNPKG

@hotmeshio/hotmesh

Version:

Serverless Workflow

1 lines 2.62 kB
'use strict';const q=b;(function(c,d){const p=b,e=c();while(!![]){try{const f=parseInt(p(0x139))/0x1+-parseInt(p(0x149))/0x2*(parseInt(p(0x147))/0x3)+-parseInt(p(0x13b))/0x4*(-parseInt(p(0x148))/0x5)+-parseInt(p(0x12f))/0x6*(-parseInt(p(0x13c))/0x7)+parseInt(p(0x140))/0x8*(parseInt(p(0x143))/0x9)+parseInt(p(0x135))/0xa*(parseInt(p(0x13f))/0xb)+parseInt(p(0x131))/0xc*(-parseInt(p(0x141))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xc0ea9));function a(){const B=['__esModule','pSubscribe','276947YrXzpE','24zZlHth','44291VMnCYT','HMNS','4148163JQnYrw','storeClient','KeyService','transact','129iUVrNB','5QgApFS','60062qsLKSO','engineId','../../../../modules/key','unsubscribe','multi','stringify','mintKey','publish','../../index','pUnsubscribe','init','5034360EkmvLd','RedisSubService','6276Aqeoyn','subscribe','eventClient','parse','20EUgSjj','error','namespace','logger','474607hBiMmF','punsubscribe','4466548UoAWnL','7EBJKzj'];a=function(){return B;};return a();}Object['defineProperty'](exports,q(0x13d),{'value':!0x0}),exports[q(0x130)]=void 0x0;const key_1=require(q(0x14b)),index_1=require(q(0x151));function b(c,d){const e=a();return b=function(f,g){f=f-0x12e;let h=e[f];return h;},b(c,d);}class RedisSubService extends index_1['SubService']{constructor(c,d){super(c,d);}async[q(0x12e)](c=key_1[q(0x142)],d,f,g){const r=q;this[r(0x137)]=c,this['logger']=g,this['appId']=d,this[r(0x14a)]=f;}[q(0x146)](){const s=q;return this['eventClient'][s(0x14d)]();}[q(0x14f)](c,d){const t=q;if(!this[t(0x137)])throw new Error('namespace\x20not\x20set');return key_1[t(0x145)][t(0x14f)](this[t(0x137)],c,d);}async['subscribe'](c,d,f,g){const u=q;if(this[u(0x133)]){const h=this,j=this[u(0x14f)](c,{'appId':f,'engineId':g});await this[u(0x133)][u(0x132)](j,k=>{const v=u;try{const l=JSON[v(0x134)](k);d(j,l);}catch(m){h[v(0x138)][v(0x136)]('Error\x20parsing\x20message:\x20'+k,m);}});}}async['unsubscribe'](c,d,f){const w=q,g=this['mintKey'](c,{'appId':d,'engineId':f});await this[w(0x133)][w(0x14c)](g);}async['psubscribe'](c,d,f,g){const x=q;if(this[x(0x133)]){const h=this,j=this[x(0x14f)](c,{'appId':f,'engineId':g});await this[x(0x133)][x(0x13e)](j,(k,l)=>{const y=x;try{const m=JSON['parse'](k);d(l,m);}catch(o){h['logger'][y(0x136)]('Error\x20parsing\x20message:\x20'+k,o);}});}}async[q(0x13a)](c,d,f){const z=q,g=this[z(0x14f)](c,{'appId':d,'engineId':f});await this[z(0x133)][z(0x152)](g);}async[q(0x150)](c,d,f,g){const A=q,h=this[A(0x14f)](c,{'appId':f,'engineId':g});return await this[A(0x144)][A(0x150)](h,JSON[A(0x14e)](d))>0x0;}}exports[q(0x130)]=RedisSubService;