@hotmeshio/hotmesh 0.3.32 → 0.4.0
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.
- package/README.md +128 -823
- package/build/index.d.ts +9 -9
- package/build/index.js +10 -10
- package/build/package.json +22 -21
- package/build/types/error.d.ts +5 -5
- package/build/types/exporter.d.ts +1 -1
- package/build/types/index.d.ts +3 -3
- package/build/types/manifest.d.ts +2 -2
- package/build/types/{meshflow.d.ts → memflow.d.ts} +15 -15
- package/build/types/meshdata.d.ts +3 -3
- package/build/types/postgres.d.ts +7 -0
- package/build/types/stream.d.ts +3 -0
- package/index.ts +11 -11
- package/package.json +22 -21
- package/typedoc.json +8 -7
- package/types/error.ts +5 -5
- package/types/exporter.ts +1 -1
- package/types/index.ts +7 -7
- package/types/manifest.ts +2 -2
- package/types/{meshflow.ts → memflow.ts} +15 -15
- package/types/meshdata.ts +3 -3
- package/types/postgres.ts +9 -0
- package/types/stream.ts +4 -0
- package/build/modules/enums.d.ts +0 -110
- package/build/modules/enums.js +0 -134
- package/build/modules/errors.d.ts +0 -124
- package/build/modules/errors.js +0 -191
- package/build/modules/key.d.ts +0 -66
- package/build/modules/key.js +0 -1
- package/build/modules/storage.d.ts +0 -3
- package/build/modules/storage.js +0 -5
- package/build/modules/utils.d.ts +0 -119
- package/build/modules/utils.js +0 -1
- package/build/services/activities/activity.d.ts +0 -104
- package/build/services/activities/activity.js +0 -1
- package/build/services/activities/await.d.ts +0 -12
- package/build/services/activities/await.js +0 -1
- package/build/services/activities/cycle.d.ts +0 -19
- package/build/services/activities/cycle.js +0 -1
- package/build/services/activities/hook.d.ts +0 -27
- package/build/services/activities/hook.js +0 -1
- package/build/services/activities/index.d.ts +0 -19
- package/build/services/activities/index.js +0 -1
- package/build/services/activities/interrupt.d.ts +0 -16
- package/build/services/activities/interrupt.js +0 -1
- package/build/services/activities/signal.d.ts +0 -20
- package/build/services/activities/signal.js +0 -1
- package/build/services/activities/trigger.d.ts +0 -37
- package/build/services/activities/trigger.js +0 -1
- package/build/services/activities/worker.d.ts +0 -12
- package/build/services/activities/worker.js +0 -1
- package/build/services/collator/index.d.ts +0 -111
- package/build/services/collator/index.js +0 -1
- package/build/services/compiler/deployer.d.ts +0 -40
- package/build/services/compiler/deployer.js +0 -1
- package/build/services/compiler/index.d.ts +0 -32
- package/build/services/compiler/index.js +0 -1
- package/build/services/compiler/validator.d.ts +0 -34
- package/build/services/compiler/validator.js +0 -1
- package/build/services/connector/factory.d.ts +0 -22
- package/build/services/connector/factory.js +0 -99
- package/build/services/connector/index.d.ts +0 -30
- package/build/services/connector/index.js +0 -54
- package/build/services/connector/providers/ioredis.d.ts +0 -9
- package/build/services/connector/providers/ioredis.js +0 -26
- package/build/services/connector/providers/nats.d.ts +0 -9
- package/build/services/connector/providers/nats.js +0 -34
- package/build/services/connector/providers/postgres.d.ts +0 -20
- package/build/services/connector/providers/postgres.js +0 -102
- package/build/services/connector/providers/redis.d.ts +0 -9
- package/build/services/connector/providers/redis.js +0 -38
- package/build/services/engine/index.d.ts +0 -264
- package/build/services/engine/index.js +0 -1
- package/build/services/exporter/index.d.ts +0 -44
- package/build/services/exporter/index.js +0 -1
- package/build/services/hotmesh/index.d.ts +0 -340
- package/build/services/hotmesh/index.js +0 -479
- package/build/services/logger/index.d.ts +0 -16
- package/build/services/logger/index.js +0 -54
- package/build/services/mapper/index.d.ts +0 -28
- package/build/services/mapper/index.js +0 -1
- package/build/services/meshcall/index.d.ts +0 -194
- package/build/services/meshcall/index.js +0 -452
- package/build/services/meshcall/schemas/factory.d.ts +0 -9
- package/build/services/meshcall/schemas/factory.js +0 -189
- package/build/services/meshdata/index.d.ts +0 -795
- package/build/services/meshdata/index.js +0 -1235
- package/build/services/meshflow/client.d.ts +0 -108
- package/build/services/meshflow/client.js +0 -371
- package/build/services/meshflow/connection.d.ts +0 -23
- package/build/services/meshflow/connection.js +0 -33
- package/build/services/meshflow/exporter.d.ts +0 -51
- package/build/services/meshflow/exporter.js +0 -1
- package/build/services/meshflow/handle.d.ts +0 -90
- package/build/services/meshflow/handle.js +0 -176
- package/build/services/meshflow/index.d.ts +0 -111
- package/build/services/meshflow/index.js +0 -117
- package/build/services/meshflow/schemas/factory.d.ts +0 -29
- package/build/services/meshflow/schemas/factory.js +0 -2492
- package/build/services/meshflow/search.d.ts +0 -142
- package/build/services/meshflow/search.js +0 -320
- package/build/services/meshflow/worker.d.ts +0 -124
- package/build/services/meshflow/worker.js +0 -514
- package/build/services/meshflow/workflow/all.d.ts +0 -7
- package/build/services/meshflow/workflow/all.js +0 -15
- package/build/services/meshflow/workflow/common.d.ts +0 -18
- package/build/services/meshflow/workflow/common.js +0 -45
- package/build/services/meshflow/workflow/context.d.ts +0 -6
- package/build/services/meshflow/workflow/context.js +0 -45
- package/build/services/meshflow/workflow/didRun.d.ts +0 -7
- package/build/services/meshflow/workflow/didRun.js +0 -22
- package/build/services/meshflow/workflow/emit.d.ts +0 -11
- package/build/services/meshflow/workflow/emit.js +0 -29
- package/build/services/meshflow/workflow/enrich.d.ts +0 -9
- package/build/services/meshflow/workflow/enrich.js +0 -17
- package/build/services/meshflow/workflow/execChild.d.ts +0 -18
- package/build/services/meshflow/workflow/execChild.js +0 -102
- package/build/services/meshflow/workflow/hook.d.ts +0 -9
- package/build/services/meshflow/workflow/hook.js +0 -40
- package/build/services/meshflow/workflow/index.d.ts +0 -70
- package/build/services/meshflow/workflow/index.js +0 -83
- package/build/services/meshflow/workflow/interrupt.d.ts +0 -9
- package/build/services/meshflow/workflow/interrupt.js +0 -24
- package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +0 -10
- package/build/services/meshflow/workflow/isSideEffectAllowed.js +0 -33
- package/build/services/meshflow/workflow/proxyActivities.d.ts +0 -20
- package/build/services/meshflow/workflow/proxyActivities.js +0 -97
- package/build/services/meshflow/workflow/random.d.ts +0 -6
- package/build/services/meshflow/workflow/random.js +0 -16
- package/build/services/meshflow/workflow/searchMethods.d.ts +0 -6
- package/build/services/meshflow/workflow/searchMethods.js +0 -25
- package/build/services/meshflow/workflow/signal.d.ts +0 -7
- package/build/services/meshflow/workflow/signal.js +0 -28
- package/build/services/meshflow/workflow/sleepFor.d.ts +0 -8
- package/build/services/meshflow/workflow/sleepFor.js +0 -35
- package/build/services/meshflow/workflow/trace.d.ts +0 -14
- package/build/services/meshflow/workflow/trace.js +0 -33
- package/build/services/meshflow/workflow/waitFor.d.ts +0 -8
- package/build/services/meshflow/workflow/waitFor.js +0 -35
- package/build/services/meshos/index.d.ts +0 -293
- package/build/services/meshos/index.js +0 -547
- package/build/services/pipe/functions/array.d.ts +0 -17
- package/build/services/pipe/functions/array.js +0 -1
- package/build/services/pipe/functions/bitwise.d.ts +0 -9
- package/build/services/pipe/functions/bitwise.js +0 -1
- package/build/services/pipe/functions/conditional.d.ts +0 -13
- package/build/services/pipe/functions/conditional.js +0 -1
- package/build/services/pipe/functions/cron.d.ts +0 -12
- package/build/services/pipe/functions/cron.js +0 -1
- package/build/services/pipe/functions/date.d.ts +0 -58
- package/build/services/pipe/functions/date.js +0 -1
- package/build/services/pipe/functions/index.d.ts +0 -29
- package/build/services/pipe/functions/index.js +0 -1
- package/build/services/pipe/functions/json.d.ts +0 -5
- package/build/services/pipe/functions/json.js +0 -1
- package/build/services/pipe/functions/logical.d.ts +0 -5
- package/build/services/pipe/functions/logical.js +0 -1
- package/build/services/pipe/functions/math.d.ts +0 -42
- package/build/services/pipe/functions/math.js +0 -1
- package/build/services/pipe/functions/number.d.ts +0 -21
- package/build/services/pipe/functions/number.js +0 -1
- package/build/services/pipe/functions/object.d.ts +0 -25
- package/build/services/pipe/functions/object.js +0 -1
- package/build/services/pipe/functions/string.d.ts +0 -23
- package/build/services/pipe/functions/string.js +0 -1
- package/build/services/pipe/functions/symbol.d.ts +0 -12
- package/build/services/pipe/functions/symbol.js +0 -1
- package/build/services/pipe/functions/unary.d.ts +0 -7
- package/build/services/pipe/functions/unary.js +0 -1
- package/build/services/pipe/index.d.ts +0 -48
- package/build/services/pipe/index.js +0 -1
- package/build/services/quorum/index.d.ts +0 -90
- package/build/services/quorum/index.js +0 -1
- package/build/services/reporter/index.d.ts +0 -50
- package/build/services/reporter/index.js +0 -1
- package/build/services/router/index.d.ts +0 -60
- package/build/services/router/index.js +0 -1
- package/build/services/search/factory.d.ts +0 -7
- package/build/services/search/factory.js +0 -24
- package/build/services/search/index.d.ts +0 -22
- package/build/services/search/index.js +0 -10
- package/build/services/search/providers/postgres/postgres.d.ts +0 -24
- package/build/services/search/providers/postgres/postgres.js +0 -1
- package/build/services/search/providers/redis/ioredis.d.ts +0 -18
- package/build/services/search/providers/redis/ioredis.js +0 -1
- package/build/services/search/providers/redis/redis.d.ts +0 -18
- package/build/services/search/providers/redis/redis.js +0 -1
- package/build/services/serializer/index.d.ts +0 -42
- package/build/services/serializer/index.js +0 -1
- package/build/services/store/cache.d.ts +0 -67
- package/build/services/store/cache.js +0 -128
- package/build/services/store/factory.d.ts +0 -8
- package/build/services/store/factory.js +0 -24
- package/build/services/store/index.d.ts +0 -89
- package/build/services/store/index.js +0 -9
- package/build/services/store/providers/postgres/kvsql.d.ts +0 -168
- package/build/services/store/providers/postgres/kvsql.js +0 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +0 -20
- package/build/services/store/providers/postgres/kvtables.js +0 -1
- package/build/services/store/providers/postgres/kvtransaction.d.ts +0 -36
- package/build/services/store/providers/postgres/kvtransaction.js +0 -1
- package/build/services/store/providers/postgres/kvtypes/hash.d.ts +0 -60
- package/build/services/store/providers/postgres/kvtypes/hash.js +0 -1
- package/build/services/store/providers/postgres/kvtypes/list.d.ts +0 -33
- package/build/services/store/providers/postgres/kvtypes/list.js +0 -1
- package/build/services/store/providers/postgres/kvtypes/string.d.ts +0 -20
- package/build/services/store/providers/postgres/kvtypes/string.js +0 -1
- package/build/services/store/providers/postgres/kvtypes/zset.d.ts +0 -41
- package/build/services/store/providers/postgres/kvtypes/zset.js +0 -1
- package/build/services/store/providers/postgres/postgres.d.ts +0 -145
- package/build/services/store/providers/postgres/postgres.js +0 -1
- package/build/services/store/providers/redis/_base.d.ts +0 -137
- package/build/services/store/providers/redis/_base.js +0 -1
- package/build/services/store/providers/redis/ioredis.d.ts +0 -20
- package/build/services/store/providers/redis/ioredis.js +0 -1
- package/build/services/store/providers/redis/redis.d.ts +0 -18
- package/build/services/store/providers/redis/redis.js +0 -1
- package/build/services/store/providers/store-initializable.d.ts +0 -5
- package/build/services/store/providers/store-initializable.js +0 -1
- package/build/services/stream/factory.d.ts +0 -8
- package/build/services/stream/factory.js +0 -37
- package/build/services/stream/index.d.ts +0 -64
- package/build/services/stream/index.js +0 -11
- package/build/services/stream/providers/nats/nats.d.ts +0 -59
- package/build/services/stream/providers/nats/nats.js +0 -1
- package/build/services/stream/providers/postgres/kvtables.d.ts +0 -2
- package/build/services/stream/providers/postgres/kvtables.js +0 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +0 -88
- package/build/services/stream/providers/postgres/postgres.js +0 -1
- package/build/services/stream/providers/redis/ioredis.d.ts +0 -60
- package/build/services/stream/providers/redis/ioredis.js +0 -1
- package/build/services/stream/providers/redis/redis.d.ts +0 -60
- package/build/services/stream/providers/redis/redis.js +0 -1
- package/build/services/stream/providers/stream-initializable.d.ts +0 -4
- package/build/services/stream/providers/stream-initializable.js +0 -1
- package/build/services/sub/factory.d.ts +0 -7
- package/build/services/sub/factory.js +0 -29
- package/build/services/sub/index.d.ts +0 -22
- package/build/services/sub/index.js +0 -10
- package/build/services/sub/providers/nats/nats.d.ts +0 -19
- package/build/services/sub/providers/nats/nats.js +0 -1
- package/build/services/sub/providers/postgres/postgres.d.ts +0 -19
- package/build/services/sub/providers/postgres/postgres.js +0 -1
- package/build/services/sub/providers/redis/ioredis.d.ts +0 -17
- package/build/services/sub/providers/redis/ioredis.js +0 -1
- package/build/services/sub/providers/redis/redis.d.ts +0 -17
- package/build/services/sub/providers/redis/redis.js +0 -1
- package/build/services/task/index.d.ts +0 -36
- package/build/services/task/index.js +0 -1
- package/build/services/telemetry/index.d.ts +0 -52
- package/build/services/telemetry/index.js +0 -1
- package/build/services/worker/index.d.ts +0 -77
- package/build/services/worker/index.js +0 -1
- /package/build/types/{meshflow.js → memflow.js} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ILogger } from '../logger';
|
|
3
|
-
import { StoreService } from '../store';
|
|
4
|
-
import { HookInterface, HookRule } from '../../types/hook';
|
|
5
|
-
import { JobCompletionOptions, JobState } from '../../types/job';
|
|
6
|
-
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
7
|
-
import { WorkListTaskType } from '../../types/task';
|
|
8
|
-
declare class TaskService {
|
|
9
|
-
store: StoreService<ProviderClient, ProviderTransaction>;
|
|
10
|
-
logger: ILogger;
|
|
11
|
-
cleanupTimeout: NodeJS.Timeout | null;
|
|
12
|
-
isScout: boolean;
|
|
13
|
-
errorCount: number;
|
|
14
|
-
constructor(store: StoreService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
15
|
-
processWebHooks(hookEventCallback: HookInterface): Promise<void>;
|
|
16
|
-
enqueueWorkItems(keys: string[]): Promise<void>;
|
|
17
|
-
registerJobForCleanup(jobId: string, inSeconds: number, options: JobCompletionOptions): Promise<void>;
|
|
18
|
-
registerTimeHook(jobId: string, gId: string, activityId: string, type: WorkListTaskType, inSeconds: number, dad: string, transaction?: ProviderTransaction): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Should this engine instance play the role of 'scout' on behalf
|
|
21
|
-
* of the entire quorum? The scout role is responsible for processing
|
|
22
|
-
* task lists on behalf of the collective.
|
|
23
|
-
*/
|
|
24
|
-
shouldScout(): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Callback handler that takes an item from a work list and
|
|
27
|
-
* processes according to its type
|
|
28
|
-
*/
|
|
29
|
-
processTimeHooks(timeEventCallback: (jobId: string, gId: string, activityId: string, type: WorkListTaskType) => Promise<void>, listKey?: string): Promise<void>;
|
|
30
|
-
cancelCleanup(): void;
|
|
31
|
-
getHookRule(topic: string): Promise<HookRule | undefined>;
|
|
32
|
-
registerWebHook(topic: string, context: JobState, dad: string, expire: number, transaction?: ProviderTransaction): Promise<string>;
|
|
33
|
-
processWebHookSignal(topic: string, data: Record<string, unknown>): Promise<[string, string, string, string] | undefined>;
|
|
34
|
-
deleteWebHookSignal(topic: string, data: Record<string, unknown>): Promise<number>;
|
|
35
|
-
}
|
|
36
|
-
export { TaskService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';const y=b;function a(){const M=[':processed','true','processTimeHooks','errorCount','284610zbHTiG','2eCyUsF','expireJob','split','registerWebHook','99928WalkYj','shouldScout','match','getHookSignal','now','appId','HMSH_FIDELITY_SECONDS','task-process-timehooks-error','../../modules/utils','store','KeyType','jid','reserveScoutRole','SIGNALS','deleteWebHookSignal','timerId','sleepFor','actual','HMSH_SCOUT_INTERVAL_SECONDS','promise','resolve','defineProperty','1795365TnLrPf','addTaskQueues','parse','4900CmjCXF','28kwqjEm','WEBSEP','signal-not-found','registerTimeHook','935832vQylHY','3NCjfbR','processWebHooks','TaskService','getNextTask','join','conditions','HMSH_EXPIRE_DURATION','deleteHookSignal','random','1733814wYpYPi','../../modules/key','getHookRules','../pipe','signaler.registerWebHook:error:\x20hook\x20rule\x20not\x20found','getActiveTaskQueue','child','XSleepFor','floor','metadata','getHookRule','isScout','25762iudotE','cleanupTimeout','mintKey','../../modules/enums','logger','delist','266263MFNkUX','cancelCleanup'];a=function(){return M;};return a();}(function(c,d){const x=b,e=c();while(!![]){try{const f=parseInt(x(0x11c))/0x1*(-parseInt(x(0xde))/0x2)+-parseInt(x(0x101))/0x3*(parseInt(x(0x100))/0x4)+-parseInt(x(0xdd))/0x5+-parseInt(x(0x10a))/0x6+parseInt(x(0xfc))/0x7*(parseInt(x(0xe2))/0x8)+-parseInt(x(0xf8))/0x9+-parseInt(x(0xfb))/0xa*(-parseInt(x(0x116))/0xb);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x2518b));Object[y(0xf7)](exports,'__esModule',{'value':!0x0}),exports[y(0x103)]=void 0x0;function b(c,d){const e=a();return b=function(f,g){f=f-0xdb;let h=e[f];return h;},b(c,d);}const enums_1=require(y(0x119)),utils_1=require(y(0xea)),pipe_1=require(y(0x10d)),hotmesh_1=require('../../types/hotmesh'),key_1=require(y(0x10b));class TaskService{constructor(c,d){const z=y;this['cleanupTimeout']=null,this[z(0x115)]=!0x1,this[z(0xdc)]=0x0,this['logger']=d,this[z(0xeb)]=c;}async[y(0x102)](c){const A=y,d=await this[A(0xeb)][A(0x10f)]();if(d){const [f,g,h,...j]=d[A(0xe0)](key_1['WEBSEP']),k=JSON[A(0xfa)](j[A(0x105)](key_1['WEBSEP'])),l=g+A(0x11e),m=await this['store']['processTaskQueue'](g,l);m?await c(f,{...k,'id':m}):await this[A(0xeb)]['deleteProcessedTaskQueue'](d,g,l,A(0x11f)===h),setImmediate(()=>this['processWebHooks'](c));}}async['enqueueWorkItems'](c){const B=y;await this['store'][B(0xf9)](c);}async['registerJobForCleanup'](c,d=enums_1[y(0x107)],f){const C=y;d>0x0&&await this[C(0xeb)][C(0xdf)](c,d);}async[y(0xff)](d,f,g,h,j=enums_1[y(0xe8)],k,l){const D=y,m=Date[D(0xe6)]()+0x3e8*j,p=0x3e8*enums_1[D(0xe8)],q=Math[D(0x112)](m/p)*p;await this['store']['registerTimeHook'](d,f,g,h,q,k,l);}async[y(0xe3)](){const E=y,c=this[E(0x115)];return!(!c&&!(this[E(0x115)]=await this[E(0xeb)][E(0xee)]('time')))&&(c||setTimeout(()=>{const F=E;this[F(0x115)]=!0x1;},0x3e8*enums_1[E(0xf4)]),!0x0);}async[y(0xdb)](c,d){const G=y;if(await this[G(0xe3)]())try{const f=await this[G(0xeb)][G(0x104)](d);if(Array['isArray'](f)){const [g,h,j,k,l]=f;if(G(0x110)===l);else{if(G(0x11b)===l){const m=this[G(0xeb)][G(0x118)](hotmesh_1[G(0xec)][G(0xef)],{'appId':this[G(0xeb)][G(0xe7)]});await this[G(0xeb)]['delistSignalKey'](m,h);}else await c(h,j,k,l);}await(0x0,utils_1[G(0xf2)])(0x0),this[G(0xdc)]=0x0,this['processTimeHooks'](c,g);}else{if(f)await(0x0,utils_1[G(0xf2)])(0x0),this['errorCount']=0x0,this[G(0xdb)](c);else{const n=(0x0,utils_1[G(0x111)])(0x3e8*enums_1[G(0xe8)]);this[G(0x117)]=n[G(0xf1)],await n['promise'],this[G(0xdc)]=0x0,this[G(0xdb)](c);}}}catch(p){this[G(0x11a)]['warn'](G(0xe9),p),await(0x0,utils_1[G(0xf2)])(0x3e8*this[G(0xdc)]++),this[G(0xdc)]<0x5&&this[G(0xdb)](c);}else{const q=(0x0,utils_1[G(0x111)])(0x3e8*enums_1[G(0xf4)]*0x2*Math[G(0x109)]());this[G(0x117)]=q['timerId'],await q[G(0xf5)],this[G(0xdb)](c);}}[y(0x11d)](){const H=y;void 0x0!==this[H(0x117)]&&(clearTimeout(this[H(0x117)]),this['cleanupTimeout']=void 0x0);}async[y(0x114)](c){const I=y,d=await this['store'][I(0x10c)]();return d?.[c]?.[0x0];}async[y(0xe1)](d,f,g,h,j){const J=y,k=await this[J(0x114)](d);if(k){const m=k[J(0x106)][J(0xe4)][0x0]['expected'],p=pipe_1['Pipe']['resolve'](m,f),q=f[J(0x113)][J(0xed)],v=f[J(0x113)]['gid'],w={'topic':d,'resolved':p,'jobId':[k['to'],g,v,q][J(0x105)](key_1['WEBSEP']),'expire':h};return await this['store']['setHookSignal'](w,j),q;}throw new Error(J(0x10e));}async['processWebHookSignal'](d,f){const K=y,g=await this['getHookRule'](d);if(g){const h={'$self':{'hook':{'data':f}},'$hook':{'data':f}},j=g['conditions'][K(0xe4)][0x0]['actual'],k=pipe_1['Pipe'][K(0xf6)](j,h),m=await this[K(0xeb)][K(0xe5)](d,k);if(!m)return;const [p,q,v,...w]=m[K(0xe0)](key_1[K(0xfd)]);return[w[K(0x105)](key_1[K(0xfd)]),g['to'],q,v];}throw new Error(K(0xfe));}async[y(0xf0)](c,d){const L=y,f=await this[L(0x114)](c);if(f){const g={'$self':{'hook':{'data':d}},'$hook':{'data':d}},h=f['conditions'][L(0xe4)][0x0][L(0xf3)],j=pipe_1['Pipe'][L(0xf6)](h,g);return await this[L(0xeb)][L(0x108)](c,j);}throw new Error('signaler.process:error:\x20hook\x20rule\x20not\x20found');}}exports['TaskService']=TaskService;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ActivityMetadata, ActivityType, Consumes } from '../../types/activity';
|
|
2
|
-
import { JobState } from '../../types/job';
|
|
3
|
-
import { StringAnyType, StringScalarType, StringStringType } from '../../types/serializer';
|
|
4
|
-
import { StreamData, StreamRole } from '../../types/stream';
|
|
5
|
-
import { Span, Context } from '../../types/telemetry';
|
|
6
|
-
declare class TelemetryService {
|
|
7
|
-
span: Span;
|
|
8
|
-
jobSpan: Span;
|
|
9
|
-
config: ActivityType;
|
|
10
|
-
traceId: string | null;
|
|
11
|
-
spanId: string | null;
|
|
12
|
-
appId: string;
|
|
13
|
-
metadata: ActivityMetadata;
|
|
14
|
-
context: JobState;
|
|
15
|
-
leg: number;
|
|
16
|
-
constructor(appId: string, config?: ActivityType, metadata?: ActivityMetadata, context?: JobState);
|
|
17
|
-
/**
|
|
18
|
-
* too chatty for production; only output traces, jobs, triggers and workers
|
|
19
|
-
*/
|
|
20
|
-
private shouldCreateSpan;
|
|
21
|
-
private static createNoopSpan;
|
|
22
|
-
getJobParentSpanId(): string | undefined;
|
|
23
|
-
getActivityParentSpanId(leg: number): string | undefined;
|
|
24
|
-
getTraceId(): string | undefined;
|
|
25
|
-
startJobSpan(): TelemetryService;
|
|
26
|
-
/**
|
|
27
|
-
* Traces an activity.
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
static traceActivity(appId: string, attributes: StringScalarType, activityId: string, traceId: string, spanId: string, index?: number): Promise<boolean>;
|
|
31
|
-
startActivitySpan(leg?: number): TelemetryService;
|
|
32
|
-
startStreamSpan(data: StreamData, role: StreamRole): TelemetryService;
|
|
33
|
-
startSpan(traceId: string, spanId: string, spanName: string, attributes: StringScalarType, bCreate?: boolean): Span;
|
|
34
|
-
mapActivityAttributes(): void;
|
|
35
|
-
setActivityAttributes(attributes: StringScalarType): void;
|
|
36
|
-
setStreamAttributes(attributes: StringScalarType): void;
|
|
37
|
-
setJobAttributes(attributes: StringScalarType): void;
|
|
38
|
-
endJobSpan(): void;
|
|
39
|
-
endActivitySpan(): void;
|
|
40
|
-
endStreamSpan(): void;
|
|
41
|
-
endSpan(span: Span): void;
|
|
42
|
-
getParentSpanContext(): undefined | Context;
|
|
43
|
-
getSpanAttrs(leg: number): StringAnyType;
|
|
44
|
-
getStreamSpanAttrs(input: StreamData): StringAnyType;
|
|
45
|
-
setTelemetryContext(span: Span, leg: number): void;
|
|
46
|
-
setActivityError(message: string): void;
|
|
47
|
-
setStreamError(message: string): void;
|
|
48
|
-
static addTargetTelemetryPaths(consumes: Consumes, config: ActivityType, metadata: ActivityMetadata, leg: number): void;
|
|
49
|
-
static bindJobTelemetryToState(state: StringStringType, config: ActivityType, context: JobState): void;
|
|
50
|
-
static bindActivityTelemetryToState(state: StringAnyType, config: ActivityType, metadata: ActivityMetadata, context: JobState, leg: number): void;
|
|
51
|
-
}
|
|
52
|
-
export { TelemetryService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x169;let h=e[f];return h;},b(c,d);}const y=b;(function(c,d){const w=b,e=c();while(!![]){try{const f=-parseInt(w(0x1ab))/0x1+-parseInt(w(0x192))/0x2+parseInt(w(0x1be))/0x3*(parseInt(w(0x1a0))/0x4)+-parseInt(w(0x179))/0x5+-parseInt(w(0x176))/0x6*(parseInt(w(0x172))/0x7)+parseInt(w(0x1b2))/0x8*(-parseInt(w(0x1d1))/0x9)+parseInt(w(0x1d2))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x64e00));var __importDefault=this&&this['__importDefault']||function(c){const x=b;return c&&c[x(0x193)]?c:{'default':c};};Object[y(0x173)](exports,'__esModule',{'value':!0x0}),exports[y(0x16b)]=void 0x0;function a(){const a1=['toUpperCase','startActivitySpan','createNoopSpan','setActivityAttributes','topic','string','../../package.json','name','setAttributes','endActivitySpan','5031009ToamEB','17744960KESZRM','parent','trace','../mapper','getStreamSpanAttrs','TelemetryService','bindJobTelemetryToState','SYSTEM','reduce','WORKER','getJobParentSpanId','app.job.','876701YNHSHM','defineProperty','trc','JOB/','12CoFDuX','EXECUTE','version','1537720KzylQf','setActivityError','setStreamError','l1s','spanContext','type','setSpanContext','context','l2s','setJobAttributes','$self','StreamDataType','getTracer','app.stream.','app.activity.data.','../../types/stream','endStreamSpan','ERROR','trigger','config','traceId','HMSH_TELEMETRY','StreamRole','TRACE/','app.activity.','239772rWsXaM','__esModule','metadata','/output/metadata/l2s','jobSpan','debug','/output/metadata/','subscribes','number','FANOUT','keys','includes','telemetry','span','1588ndZXtO','traceActivity','end','SpanKind','spanId','push','SpanStatusCode','default','startSpan','signal','getTraceId','767138pviNDV','/output/metadata/l1s','hook','endSpan','output','bindActivityTelemetryToState','../../types/telemetry','8GJNWod','../../modules/enums','getSpanAttrs','MapperService','appId','spn','RESULT','active','CLIENT','boolean','setTelemetryContext','aid','4857hREGgy','addTargetTelemetryPaths','shouldCreateSpan','with','setStatus','endJobSpan','leg','getActivityParentSpanId','getParentSpanContext'];a=function(){return a1;};return a();}const package_json_1=__importDefault(require(y(0x1cd))),mapper_1=require(y(0x169)),stream_1=require(y(0x188)),telemetry_1=require(y(0x1b1)),enums_1=require(y(0x1b3));class TelemetryService{constructor(c,d,f,g){const z=y;this[z(0x1c4)]=0x1,this[z(0x1b6)]=c,this['config']=d,this[z(0x194)]=f,this[z(0x180)]=g;}['shouldCreateSpan'](){const A=y;return A(0x197)===enums_1[A(0x18e)]||A(0x18b)===this['config']?.[A(0x17e)]||'worker'===this['config']?.[A(0x17e)];}static['createNoopSpan'](c,d){return{'spanContext':()=>({'traceId':c,'spanId':d,'isRemote':!0x0,'traceFlags':0x1}),'addEvent'(f,g,h){return this;},'setAttribute'(f,g){return this;},'setAttributes'(f){return this;},'setStatus'(f){return this;},'updateName'(f){return this;},'end'(f){},'isRecording':()=>!0x1,'recordException'(f,g){}};}[y(0x170)](){const B=y;return this[B(0x180)][B(0x194)][B(0x1b7)];}[y(0x1c5)](c){const C=y;return 0x1===c?this[C(0x180)][this[C(0x18c)][C(0x1d3)]][C(0x1af)]?.['metadata']?.[C(0x181)]:this[C(0x180)]['$self'][C(0x1af)]?.[C(0x194)]?.[C(0x17c)];}[y(0x1aa)](){const D=y;return this[D(0x180)]['metadata'][D(0x174)];}['startJobSpan'](){const E=y,c=E(0x175)+this[E(0x1b6)]+'/'+this[E(0x18c)][E(0x199)]+'/1',d=this[E(0x1aa)](),f=this[E(0x170)](),g=this[E(0x1b4)](0x1),h=this['startSpan'](d,f,c,g);return this[E(0x196)]=h,this[E(0x1bc)](h,0x1),this;}static async[y(0x1a1)](c,f,g,h,j,k=0x0){const F=y,l=F(0x190)+c+'/'+g+'/'+k,m=telemetry_1[F(0x1d4)]['getTracer'](package_json_1[F(0x1a7)]['name'],package_json_1[F(0x1a7)][F(0x178)]),q={'traceId':h,'spanId':j,'isRemote':!0x0,'traceFlags':0x1},u=telemetry_1['trace'][F(0x17f)](telemetry_1[F(0x180)][F(0x1b9)](),q);return telemetry_1[F(0x180)][F(0x1c1)](u,()=>{const G=F,v=m[G(0x1a8)](l,{'kind':telemetry_1[G(0x1a3)][G(0x1ba)],'attributes':f});return v['setAttributes'](f),v[G(0x1a2)](),!0x0;});}[y(0x1c8)](c=this['leg']){const H=y,d=this['config'][H(0x17e)][H(0x1c7)]()+'/'+this[H(0x1b6)]+'/'+this[H(0x194)][H(0x1bd)]+'/'+c,f=this[H(0x1aa)](),g=this[H(0x1c5)](c),h=this[H(0x1b4)](c),j=this[H(0x1a8)](f,g,d,h);return this[H(0x19f)]=j,this[H(0x1bc)](j,c),this;}['startStreamSpan'](c,d){const I=y;let f;if(f=d===stream_1['StreamRole'][I(0x16d)]?I(0x16d):d===stream_1[I(0x18f)][I(0x16f)]?I(0x177):c[I(0x17e)]===stream_1[I(0x184)][I(0x1b8)]||c[I(0x17e)]===stream_1[I(0x184)]['RESPONSE']?'FANIN':I(0x19b),this[I(0x1c0)]()||I(0x177)===f||'SYSTEM'===f){const g=c[I(0x194)][I(0x1cb)]?'/'+c[I(0x194)][I(0x1cb)]:'',h=f+'/'+this[I(0x1b6)]+'/'+c[I(0x194)][I(0x1bd)]+g,i=this[I(0x16a)](c);this['span']=this[I(0x1a8)](c[I(0x194)]['trc'],c[I(0x194)][I(0x1b7)],h,i,!0x0);}else this[I(0x18d)]=c[I(0x194)][I(0x174)],this[I(0x1a4)]=c[I(0x194)][I(0x1b7)],this[I(0x19f)]=TelemetryService[I(0x1c9)](c[I(0x194)][I(0x174)],c[I(0x194)][I(0x1b7)]);return this;}['startSpan'](c,d,f,g,h=!0x1){const J=y;if(this['traceId']=c,this[J(0x1a4)]=d,h||this[J(0x1c0)]()){const i=telemetry_1[J(0x1d4)][J(0x185)](package_json_1['default'][J(0x1ce)],package_json_1[J(0x1a7)]['version']),j=this[J(0x1c6)]();return i['startSpan'](f,{'kind':telemetry_1['SpanKind'][J(0x1ba)],'attributes':g,'root':!j},j);}return TelemetryService[J(0x1c9)](c,d);}['mapActivityAttributes'](){const K=y;if(this[K(0x18c)]['telemetry']&&this['span']){const c=new mapper_1[(K(0x1b5))](this[K(0x18c)][K(0x19e)],this[K(0x180)])['mapRules'](),d={...Object['keys'](c)[K(0x16e)]((f,g)=>([K(0x1cc),K(0x1bb),K(0x19a)][K(0x19d)](typeof c[g])&&(f[K(0x187)+g]=c[g]),f),{})};this['span'][K(0x1cf)](d);}}[y(0x1ca)](c){const L=y;this[L(0x19f)]?.[L(0x1cf)](c);}['setStreamAttributes'](c){const M=y;this[M(0x19f)]?.[M(0x1cf)](c);}[y(0x182)](c){const N=y;this[N(0x196)]?.[N(0x1cf)](c);}[y(0x1c3)](){const O=y;this[O(0x1ae)](this[O(0x196)]);}[y(0x1d0)](){const P=y;this[P(0x1ae)](this['span']);}[y(0x189)](){const Q=y;this[Q(0x1ae)](this['span']);}[y(0x1ae)](c){const R=y;c&&c[R(0x1a2)]();}[y(0x1c6)](){const S=y;if(this[S(0x18d)]&&this[S(0x1a4)]){const c={'traceId':this[S(0x18d)],'spanId':this[S(0x1a4)],'isRemote':!0x0,'traceFlags':0x1};return telemetry_1[S(0x1d4)][S(0x17f)](telemetry_1['context'][S(0x1b9)](),c);}}['getSpanAttrs'](c){const T=y;return{...Object[T(0x19c)](this[T(0x180)]['metadata'])[T(0x16e)]((d,f)=>(T(0x174)!==f&&(d[T(0x171)+f]=this[T(0x180)][T(0x194)][f]),d),{}),...Object[T(0x19c)](this[T(0x194)])[T(0x16e)]((d,f)=>(d[T(0x191)+f]=this[T(0x194)][f],d),{}),'app.activity.leg':c};}[y(0x16a)](c){const U=y;return{...Object[U(0x19c)](c[U(0x194)])[U(0x16e)]((d,f)=>(U(0x174)!==f&&U(0x1b7)!==f&&(d[U(0x186)+f]=c['metadata'][f]),d),{})};}[y(0x1bc)](c,d){const V=y;this[V(0x180)][V(0x194)][V(0x174)]||(this['context'][V(0x194)][V(0x174)]=c['spanContext']()[V(0x18d)]),this['context'][V(0x183)]['output'][V(0x194)]||(this['context']['$self'][V(0x1af)][V(0x194)]={}),0x1===d?this[V(0x180)][V(0x183)][V(0x1af)][V(0x194)][V(0x17c)]=c[V(0x17d)]()[V(0x1a4)]:this[V(0x180)][V(0x183)]['output']['metadata']['l2s']=c[V(0x17d)]()[V(0x1a4)];}[y(0x17a)](c){const W=y;this['span']?.[W(0x1c2)]({'code':telemetry_1[W(0x1a6)]['ERROR'],'message':c});}[y(0x17b)](c){const X=y;this[X(0x19f)]?.[X(0x1c2)]({'code':telemetry_1[X(0x1a6)][X(0x18a)],'message':c});}static[y(0x1bf)](c,d,f,g){const Y=y;0x1===g?(d[Y(0x1d3)]in c||(c[d[Y(0x1d3)]]=[]),c[d[Y(0x1d3)]][Y(0x1a5)](d[Y(0x1d3)]+'/output/metadata/l2s')):(f[Y(0x1bd)]in c||(c[f['aid']]=[]),c[f[Y(0x1bd)]][Y(0x1a5)](f['aid']+Y(0x1ac)));}static[y(0x16c)](c,d,f){const Z=y;Z(0x18b)===d[Z(0x17e)]&&(c['metadata/trc']=f[Z(0x194)][Z(0x174)]);}static[y(0x1b0)](c,d,f,g,h){const a0=y;if(a0(0x18b)===d[a0(0x17e)])c[f[a0(0x1bd)]+a0(0x1ac)]=g[a0(0x183)]['output'][a0(0x194)]['l1s'],c[f[a0(0x1bd)]+a0(0x195)]=g['$self'][a0(0x1af)]['metadata']['l2s'];else{if(a0(0x1ad)===d['type']&&0x1===h)c[f[a0(0x1bd)]+a0(0x1ac)]=g[a0(0x183)][a0(0x1af)][a0(0x194)]['l1s'],c[f[a0(0x1bd)]+'/output/metadata/l2s']=g[a0(0x183)]['output'][a0(0x194)][a0(0x17c)];else{if(a0(0x1a9)===d['type']&&0x1===h)c[f[a0(0x1bd)]+a0(0x1ac)]=g[a0(0x183)][a0(0x1af)]['metadata']['l1s'],c[f[a0(0x1bd)]+'/output/metadata/l2s']=g[a0(0x183)][a0(0x1af)]['metadata']['l1s'];else{const i='l'+h+'s';c[f[a0(0x1bd)]+a0(0x198)+i]=g[a0(0x183)][a0(0x1af)]['metadata'][i];}}}}}exports['TelemetryService']=TelemetryService;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ILogger } from '../logger';
|
|
3
|
-
import { Router } from '../router';
|
|
4
|
-
import { StoreService } from '../store';
|
|
5
|
-
import { StreamService } from '../stream';
|
|
6
|
-
import { SubService } from '../sub';
|
|
7
|
-
import { HotMeshConfig, HotMeshWorker } from '../../types/hotmesh';
|
|
8
|
-
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
9
|
-
import { RollCallMessage, SubscriptionCallback } from '../../types/quorum';
|
|
10
|
-
import { StreamData, StreamDataResponse } from '../../types/stream';
|
|
11
|
-
declare class WorkerService {
|
|
12
|
-
namespace: string;
|
|
13
|
-
appId: string;
|
|
14
|
-
guid: string;
|
|
15
|
-
topic: string;
|
|
16
|
-
config: HotMeshConfig;
|
|
17
|
-
callback: (streamData: StreamData) => Promise<StreamDataResponse | void>;
|
|
18
|
-
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
19
|
-
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
20
|
-
subscribe: SubService<ProviderClient> | null;
|
|
21
|
-
router: Router<typeof this.stream> | null;
|
|
22
|
-
logger: ILogger;
|
|
23
|
-
reporting: boolean;
|
|
24
|
-
inited: string;
|
|
25
|
-
rollCallInterval: NodeJS.Timeout;
|
|
26
|
-
/**
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
constructor();
|
|
30
|
-
/**
|
|
31
|
-
* @private
|
|
32
|
-
*/
|
|
33
|
-
static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<WorkerService[]>;
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
verifyWorkerFields(worker: HotMeshWorker): void;
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
initStoreChannel(service: WorkerService, store: ProviderClient): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
initSubChannel(service: WorkerService, sub: ProviderClient, store: ProviderClient): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
initStreamChannel(service: WorkerService, stream: ProviderClient, store: ProviderClient): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
initRouter(worker: HotMeshWorker, logger: ILogger): Promise<Router<StreamService<ProviderClient, ProviderTransaction>>>;
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
subscriptionHandler(): SubscriptionCallback;
|
|
58
|
-
/**
|
|
59
|
-
* A quorum-wide command to broadcaset system details.
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
doRollCall(message: RollCallMessage): Promise<void>;
|
|
63
|
-
cancelRollCall(): void;
|
|
64
|
-
/**
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
stop(): void;
|
|
68
|
-
/**
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
sayPong(appId: string, guid: string, originator?: string, details?: boolean, signature?: boolean): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* @private
|
|
74
|
-
*/
|
|
75
|
-
throttle(delayInMillis: number): Promise<void>;
|
|
76
|
-
}
|
|
77
|
-
export { WorkerService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function a(){const F=['store','isArray','rollCallInterval','defineProperty','initRouter','doRollCall','SubServiceFactory','guid','1089756ohnvKa','reclaimCount','../sub/factory','logger','subscriptionHandler','initSubChannel','router','appId','setThrottle','94764nuydeM','consumeMessages','max','ceil','HMSH_QUORUM_ROLLCALL_CYCLES','subscribe','originator','stop','WORKER','722010judZMi','identifyProvider','sayPong','initStreamChannel','interval','getThrottleRate','93270LSqRkH','279630CoFiWa','inited','stream','toString','ConnectorService','reclaimDelay','../../modules/utils','mintKey','STREAMS','topic','verifyWorkerFields','throttle','ping','cancelRollCall','StreamServiceFactory','../../modules/enums','pub','counts','96525LdHsts','signature','pong','__esModule','../stream/factory','config','type','callback','details','initClients','worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.','namespace','init','306936XSbZdV','KeyType','QUORUM','WorkerService','initStoreChannel','worker-event-received','../connector/factory','reporting','formatISODate','StreamRole','random','StoreServiceFactory','../store/factory'];a=function(){return F;};return a();}const r=b;(function(c,d){const q=b,e=c();while(!![]){try{const f=-parseInt(q(0x1d9))/0x1+-parseInt(q(0x214))/0x2+-parseInt(q(0x213))/0x3+parseInt(q(0x1fb))/0x4+parseInt(q(0x20d))/0x5+-parseInt(q(0x204))/0x6+parseInt(q(0x1e6))/0x7;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x2b539));function b(c,d){const e=a();return b=function(f,g){f=f-0x1cb;let h=e[f];return h;},b(c,d);}Object[r(0x1f6)](exports,r(0x1dc),{'value':!0x0}),exports[r(0x1e9)]=void 0x0;const key_1=require('../../modules/key'),utils_1=require(r(0x1cd)),factory_1=require(r(0x1ec)),router_1=require('../router'),stream_1=require('../../types/stream'),enums_1=require(r(0x1d6)),factory_2=require(r(0x1dd)),factory_3=require(r(0x1fd)),factory_4=require(r(0x1f2));class WorkerService{constructor(){const s=r;this[s(0x1ed)]=!0x1;}static async['init'](c,d,f,g,h){const t=r,j=[];if(Array[t(0x1f4)](g['workers']))for(const k of g['workers']){await factory_1[t(0x1cb)][t(0x1e2)](k);const m=new WorkerService();m[t(0x1d1)](k),m[t(0x1e4)]=c,m[t(0x202)]=d,m[t(0x1fa)]=f,m[t(0x1e0)]=k['callback'],m['topic']=k['topic'],m[t(0x1de)]=g,m[t(0x1fe)]=h,await m['initStoreChannel'](m,k[t(0x1f3)]),await m[t(0x200)](m,k['sub'],k[t(0x1d7)]??k[t(0x1f3)]),await m[t(0x209)][t(0x209)](key_1[t(0x1e7)]['QUORUM'],m[t(0x1ff)](),d),await m[t(0x209)]['subscribe'](key_1[t(0x1e7)]['QUORUM'],m[t(0x1ff)](),d,m[t(0x1d0)]),await m[t(0x209)][t(0x209)](key_1[t(0x1e7)][t(0x1e8)],m[t(0x1ff)](),d,m[t(0x1fa)]),await m[t(0x210)](m,k[t(0x216)],k['store']),m[t(0x201)]=await m[t(0x1f7)](k,h);const p=m[t(0x1f3)][t(0x1ce)](key_1[t(0x1e7)][t(0x1cf)],{'appId':m[t(0x202)],'topic':k['topic']});await m[t(0x201)][t(0x205)](p,t(0x20c),m[t(0x1fa)],k[t(0x1e0)]),m[t(0x215)]=(0x0,utils_1[t(0x1ee)])(new Date()),j['push'](m);}return j;}[r(0x1d1)](c){const u=r;if(!((0x0,utils_1[u(0x20e)])(c[u(0x1f3)])&&(0x0,utils_1[u(0x20e)])(c[u(0x216)])&&(0x0,utils_1[u(0x20e)])(c['sub'])&&c['topic']&&c['callback']))throw new Error(u(0x1e3));}async[r(0x1ea)](c,d){const v=r;c[v(0x1f3)]=await factory_4[v(0x1f1)][v(0x1e5)](d,c[v(0x1e4)],c['appId'],c[v(0x1fe)]);}async[r(0x200)](c,d,f){const w=r;c[w(0x209)]=await factory_3[w(0x1f9)][w(0x1e5)](d,f,c[w(0x1e4)],c[w(0x202)],c[w(0x1fa)],c[w(0x1fe)]);}async[r(0x210)](c,d,f){const x=r;c[x(0x216)]=await factory_2[x(0x1d5)][x(0x1e5)](d,f,c[x(0x1e4)],c[x(0x202)],c[x(0x1fe)]);}async[r(0x1f7)](c,d){const y=r,f=await this['store'][y(0x212)](c[y(0x1d0)]);return new router_1['Router']({'namespace':this[y(0x1e4)],'appId':this[y(0x202)],'guid':this[y(0x1fa)],'role':stream_1[y(0x1ef)]['WORKER'],'topic':c[y(0x1d0)],'reclaimDelay':c[y(0x1cc)],'reclaimCount':c['reclaimCount'],'throttle':f},this['stream'],d);}[r(0x1ff)](){const c=this;return async(d,f)=>{const z=b;c['logger']['debug'](z(0x1eb),{'topic':d,'type':f['type']}),'throttle'===f[z(0x1df)]?null!==f[z(0x1d0)]&&c[z(0x1d2)](f[z(0x1d2)]):z(0x1d3)===f['type']?c[z(0x20f)](c[z(0x202)],c['guid'],f[z(0x20a)],f[z(0x1e1)]):'rollcall'===f[z(0x1df)]&&null!==f[z(0x1d0)]&&c[z(0x1f8)](f);};}async[r(0x1f8)](c){const A=r;let d=0x0;const f=isNaN(c[A(0x206)])?enums_1[A(0x208)]:c[A(0x206)];this[A(0x1f5)]&&clearTimeout(this[A(0x1f5)]);const g=c['interval']/0x2,h=g+Math[A(0x207)](Math[A(0x1f0)]()*g);do{if(await(0x0,utils_1['sleepFor'])(Math['ceil'](0x3e8*Math[A(0x1f0)]())),await this[A(0x20f)](this[A(0x202)],this['guid'],null,!0x0,c[A(0x1da)]),!c[A(0x211)])return;const {promise:j,timerId:k}=(0x0,utils_1['XSleepFor'])(0x3e8*h);this[A(0x1f5)]=k,await j;}while(this['rollCallInterval']&&d++<f-0x1);}[r(0x1d4)](){const B=r;this[B(0x1f5)]&&(clearTimeout(this[B(0x1f5)]),delete this['rollCallInterval']);}[r(0x20b)](){const C=r;this[C(0x1d4)]();}async[r(0x20f)](c,d,f,g=!0x1,h=!0x1){const D=r;let j;if(g){const k={'appId':this[D(0x202)],'topic':this[D(0x1d0)]};j={'engine_id':this[D(0x1fa)],'namespace':this[D(0x1e4)],'app_id':this[D(0x202)],'worker_topic':this['topic'],'stream':this[D(0x1f3)][D(0x1ce)](key_1[D(0x1e7)][D(0x1cf)],k),'counts':this[D(0x201)]?.[D(0x1d8)],'timestamp':(0x0,utils_1[D(0x1ee)])(new Date()),'inited':this[D(0x215)],'throttle':this[D(0x201)]?.['throttle'],'reclaimDelay':this[D(0x201)]?.['reclaimDelay'],'reclaimCount':this['router']?.[D(0x1fc)],'system':await(0x0,utils_1['getSystemHealth'])(),'signature':h?this['callback'][D(0x217)]():void 0x0};}this[D(0x209)]['publish'](key_1[D(0x1e7)]['QUORUM'],{'type':D(0x1db),'guid':d,'originator':f,'profile':j},c);}async[r(0x1d2)](c){const E=r;this[E(0x201)]?.[E(0x203)](c);}}exports[r(0x1e9)]=WorkerService;
|
|
File without changes
|