@hotmeshio/hotmesh 0.8.0 → 0.9.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/.claude/settings.local.json +2 -1
- package/README.md +158 -38
- package/build/package.json +62 -67
- package/build/services/activities/activity.d.ts +58 -7
- package/build/services/activities/activity.js +66 -37
- package/build/services/activities/await.d.ts +101 -0
- package/build/services/activities/await.js +101 -0
- package/build/services/activities/cycle.d.ts +82 -0
- package/build/services/activities/cycle.js +86 -8
- package/build/services/activities/hook.d.ts +139 -1
- package/build/services/activities/hook.js +140 -2
- package/build/services/activities/interrupt.d.ts +112 -0
- package/build/services/activities/interrupt.js +118 -5
- package/build/services/activities/signal.d.ts +108 -3
- package/build/services/activities/signal.js +113 -8
- package/build/services/activities/trigger.d.ts +56 -4
- package/build/services/activities/trigger.js +119 -35
- package/build/services/activities/worker.d.ts +107 -0
- package/build/services/activities/worker.js +107 -0
- package/build/services/collator/index.d.ts +3 -15
- package/build/services/collator/index.js +7 -34
- package/build/services/engine/index.d.ts +18 -2
- package/build/services/engine/index.js +14 -4
- package/build/services/exporter/index.d.ts +2 -0
- package/build/services/exporter/index.js +1 -0
- package/build/services/hotmesh/index.d.ts +471 -236
- package/build/services/hotmesh/index.js +473 -238
- package/build/services/memflow/client.js +2 -2
- package/build/services/memflow/handle.js +1 -1
- package/build/services/memflow/index.d.ts +1 -1
- package/build/services/memflow/index.js +1 -1
- package/build/services/memflow/workflow/all.d.ts +28 -3
- package/build/services/memflow/workflow/all.js +28 -3
- package/build/services/memflow/workflow/context.d.ts +44 -1
- package/build/services/memflow/workflow/context.js +44 -1
- package/build/services/memflow/workflow/didRun.d.ts +23 -3
- package/build/services/memflow/workflow/didRun.js +23 -3
- package/build/services/memflow/workflow/emit.d.ts +43 -4
- package/build/services/memflow/workflow/emit.js +43 -4
- package/build/services/memflow/workflow/enrich.d.ts +32 -4
- package/build/services/memflow/workflow/enrich.js +32 -4
- package/build/services/memflow/workflow/entityMethods.d.ts +54 -7
- package/build/services/memflow/workflow/entityMethods.js +54 -7
- package/build/services/memflow/workflow/execChild.d.ts +96 -8
- package/build/services/memflow/workflow/execChild.js +96 -8
- package/build/services/memflow/workflow/execHook.d.ts +54 -39
- package/build/services/memflow/workflow/execHook.js +52 -38
- package/build/services/memflow/workflow/execHookBatch.d.ts +82 -29
- package/build/services/memflow/workflow/execHookBatch.js +80 -28
- package/build/services/memflow/workflow/hook.d.ts +68 -3
- package/build/services/memflow/workflow/hook.js +69 -4
- package/build/services/memflow/workflow/index.d.ts +65 -10
- package/build/services/memflow/workflow/index.js +65 -10
- package/build/services/memflow/workflow/interrupt.d.ts +50 -4
- package/build/services/memflow/workflow/interrupt.js +50 -4
- package/build/services/memflow/workflow/interruption.d.ts +49 -16
- package/build/services/memflow/workflow/interruption.js +49 -16
- package/build/services/memflow/workflow/isSideEffectAllowed.d.ts +21 -4
- package/build/services/memflow/workflow/isSideEffectAllowed.js +21 -4
- package/build/services/memflow/workflow/proxyActivities.d.ts +70 -42
- package/build/services/memflow/workflow/proxyActivities.js +70 -42
- package/build/services/memflow/workflow/random.d.ts +33 -3
- package/build/services/memflow/workflow/random.js +33 -3
- package/build/services/memflow/workflow/searchMethods.d.ts +49 -2
- package/build/services/memflow/workflow/searchMethods.js +49 -2
- package/build/services/memflow/workflow/signal.d.ts +51 -22
- package/build/services/memflow/workflow/signal.js +52 -23
- package/build/services/memflow/workflow/sleepFor.d.ts +57 -18
- package/build/services/memflow/workflow/sleepFor.js +57 -18
- package/build/services/memflow/workflow/trace.d.ts +39 -6
- package/build/services/memflow/workflow/trace.js +39 -6
- package/build/services/memflow/workflow/waitFor.d.ts +55 -18
- package/build/services/memflow/workflow/waitFor.js +55 -18
- package/build/services/store/index.d.ts +1 -1
- package/build/services/store/providers/postgres/postgres.d.ts +1 -1
- package/build/services/store/providers/postgres/postgres.js +4 -3
- package/build/services/telemetry/index.js +6 -0
- package/build/types/activity.d.ts +1 -1
- package/build/types/hotmesh.d.ts +1 -1
- package/build/types/job.d.ts +1 -1
- package/build/types/memflow.d.ts +1 -1
- package/build/types/quorum.d.ts +2 -2
- package/build/vitest.config.d.ts +2 -0
- package/build/vitest.config.js +18 -0
- package/package.json +62 -67
- package/vitest.config.ts +17 -0
|
@@ -183,7 +183,7 @@ class EngineService {
|
|
|
183
183
|
* @private
|
|
184
184
|
*/
|
|
185
185
|
async processWebHooks() {
|
|
186
|
-
this.taskService.processWebHooks(this.
|
|
186
|
+
this.taskService.processWebHooks(this.signal.bind(this));
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* @private
|
|
@@ -457,11 +457,17 @@ class EngineService {
|
|
|
457
457
|
//todo: do not allow scrubbing of non-existent or actively running job
|
|
458
458
|
await this.store.scrub(jobId);
|
|
459
459
|
}
|
|
460
|
-
// ****************** `
|
|
460
|
+
// ****************** `SIGNAL` ACTIVITY RE-ENTRY POINT ****************
|
|
461
461
|
/**
|
|
462
|
+
* Delivers a signal (data payload) to a paused hook activity,
|
|
463
|
+
* resuming its Leg 2 execution. The `topic` must match a hook rule
|
|
464
|
+
* defined in the YAML graph's `hooks` section. The engine locates
|
|
465
|
+
* the target activity and dimension for reentry based on the hook
|
|
466
|
+
* rule's match conditions.
|
|
467
|
+
*
|
|
462
468
|
* @private
|
|
463
469
|
*/
|
|
464
|
-
async
|
|
470
|
+
async signal(topic, data, status = stream_1.StreamStatus.SUCCESS, code = 200, transaction) {
|
|
465
471
|
const hookRule = await this.taskService.getHookRule(topic);
|
|
466
472
|
const [aid] = await this.getSchema(`.${hookRule.to}`);
|
|
467
473
|
const streamData = {
|
|
@@ -503,9 +509,13 @@ class EngineService {
|
|
|
503
509
|
await this.router?.publishMessage(null, streamData);
|
|
504
510
|
}
|
|
505
511
|
/**
|
|
512
|
+
* Fan-out variant of `signal()` that delivers data to **all**
|
|
513
|
+
* paused workflows matching a search query. Useful for resuming
|
|
514
|
+
* a batch of workflows waiting on the same external event.
|
|
515
|
+
*
|
|
506
516
|
* @private
|
|
507
517
|
*/
|
|
508
|
-
async
|
|
518
|
+
async signalAll(hookTopic, data, keyResolver, queryFacets = []) {
|
|
509
519
|
const config = await this.getVID();
|
|
510
520
|
const hookRule = await this.taskService.getHookRule(hookTopic);
|
|
511
521
|
if (hookRule) {
|
|
@@ -10,8 +10,10 @@ import { StringStringType, Symbols } from '../../types/serializer';
|
|
|
10
10
|
declare class ExporterService {
|
|
11
11
|
appId: string;
|
|
12
12
|
logger: ILogger;
|
|
13
|
+
/** @hidden */
|
|
13
14
|
store: StoreService<ProviderClient, ProviderTransaction>;
|
|
14
15
|
symbols: Promise<Symbols> | Symbols;
|
|
16
|
+
/** @hidden */
|
|
15
17
|
constructor(appId: string, store: StoreService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
16
18
|
/**
|
|
17
19
|
* Convert the job hash into a JobExport object.
|