@hotmeshio/hotmesh 0.3.31 → 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 -108
- package/build/modules/enums.js +0 -132
- 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,340 +0,0 @@
|
|
|
1
|
-
import { EngineService } from '../engine';
|
|
2
|
-
import { ILogger } from '../logger';
|
|
3
|
-
import { QuorumService } from '../quorum';
|
|
4
|
-
import { WorkerService } from '../worker';
|
|
5
|
-
import { JobState, JobData, JobOutput, JobStatus, JobInterruptOptions, ExtensionType } from '../../types/job';
|
|
6
|
-
import { HotMeshConfig, HotMeshManifest } from '../../types/hotmesh';
|
|
7
|
-
import { JobExport } from '../../types/exporter';
|
|
8
|
-
import { JobMessageCallback, QuorumMessage, QuorumMessageCallback, QuorumProfile, ThrottleOptions } from '../../types/quorum';
|
|
9
|
-
import { StringAnyType, StringStringType } from '../../types/serializer';
|
|
10
|
-
import { JobStatsInput, GetStatsOptions, IdsResponse, StatsResponse } from '../../types/stats';
|
|
11
|
-
import { StreamCode, StreamData, StreamDataResponse, StreamStatus } from '../../types/stream';
|
|
12
|
-
/**
|
|
13
|
-
* This example shows the full lifecycle of a HotMesh engine instance,
|
|
14
|
-
* including: initialization, deployment, activation and execution.
|
|
15
|
-
*
|
|
16
|
-
* Engine routers are self-managing, but subscribe to the 'quorum' channel
|
|
17
|
-
* to establish consensus as necessary for distributed processing.
|
|
18
|
-
* Completed workflows are always soft-deleted with a configurable
|
|
19
|
-
* retention period.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* import { Client as Postgres } from 'pg';
|
|
24
|
-
* import { HotMesh } from '@hotmeshio/hotmesh';
|
|
25
|
-
*
|
|
26
|
-
* const hotMesh = await HotMesh.init({
|
|
27
|
-
* appId: 'abc',
|
|
28
|
-
* engine: {
|
|
29
|
-
* connection: {
|
|
30
|
-
* class: Postgres,
|
|
31
|
-
* options: {
|
|
32
|
-
* connectionString: 'postgresql://usr:pwd@localhost:5432/db',
|
|
33
|
-
* }
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* });
|
|
37
|
-
*
|
|
38
|
-
* await hotMesh.deploy(`
|
|
39
|
-
* app:
|
|
40
|
-
* id: abc
|
|
41
|
-
* version: '1'
|
|
42
|
-
* graphs:
|
|
43
|
-
* - subscribes: abc.test
|
|
44
|
-
* activities:
|
|
45
|
-
* t1:
|
|
46
|
-
* type: trigger
|
|
47
|
-
* `);
|
|
48
|
-
*
|
|
49
|
-
* await hotMesh.activate('1');
|
|
50
|
-
*
|
|
51
|
-
* await hotMesh.pubsub('abc.test');
|
|
52
|
-
*
|
|
53
|
-
* await HotMesh.stop();
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
declare class HotMesh {
|
|
57
|
-
namespace: string;
|
|
58
|
-
appId: string;
|
|
59
|
-
guid: string;
|
|
60
|
-
/**
|
|
61
|
-
* @private
|
|
62
|
-
*/
|
|
63
|
-
engine: EngineService | null;
|
|
64
|
-
/**
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
quorum: QuorumService | null;
|
|
68
|
-
/**
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
workers: WorkerService[];
|
|
72
|
-
logger: ILogger;
|
|
73
|
-
static disconnecting: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
verifyAndSetNamespace(namespace?: string): void;
|
|
78
|
-
/**
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
verifyAndSetAppId(appId: string): void;
|
|
82
|
-
/**
|
|
83
|
-
* Instance initializer. Workers are configured
|
|
84
|
-
* similarly to the engine, but as an array with
|
|
85
|
-
* multiple worker objects.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const config: HotMeshConfig = {
|
|
90
|
-
* appId: 'myapp',
|
|
91
|
-
* engine: {
|
|
92
|
-
* connection: {
|
|
93
|
-
* class: Postgres,
|
|
94
|
-
* options: {
|
|
95
|
-
* connectionString: 'postgresql://usr:pwd@localhost:5432/db',
|
|
96
|
-
* }
|
|
97
|
-
* }
|
|
98
|
-
* },
|
|
99
|
-
* workers [...]
|
|
100
|
-
* };
|
|
101
|
-
* const hotMesh = await HotMesh.init(config);
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
static init(config: HotMeshConfig): Promise<HotMesh>;
|
|
105
|
-
/**
|
|
106
|
-
* returns a guid using the same core guid
|
|
107
|
-
* generator used by the HotMesh (nanoid)
|
|
108
|
-
*/
|
|
109
|
-
static guid(): string;
|
|
110
|
-
/**
|
|
111
|
-
* @private
|
|
112
|
-
*/
|
|
113
|
-
initEngine(config: HotMeshConfig, logger: ILogger): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* @private
|
|
116
|
-
*/
|
|
117
|
-
initQuorum(config: HotMeshConfig, engine: EngineService, logger: ILogger): Promise<void>;
|
|
118
|
-
/**
|
|
119
|
-
* @private
|
|
120
|
-
*/
|
|
121
|
-
constructor();
|
|
122
|
-
/**
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
doWork(config: HotMeshConfig, logger: ILogger): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Starts a workflow
|
|
128
|
-
* @example
|
|
129
|
-
* ```typescript
|
|
130
|
-
* await hotMesh.pub('a.b.c', { key: 'value' });
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
pub(topic: string, data?: JobData, context?: JobState, extended?: ExtensionType): Promise<string>;
|
|
134
|
-
/**
|
|
135
|
-
* Subscribe (listen) to all output and interim emissions of a single
|
|
136
|
-
* workflow topic. NOTE: Postgres does not support patterned
|
|
137
|
-
* unsubscription, so this method is not supported for Postgres.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* await hotMesh.psub('a.b.c', (topic, message) => {
|
|
142
|
-
* console.log(message);
|
|
143
|
-
* });
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
sub(topic: string, callback: JobMessageCallback): Promise<void>;
|
|
147
|
-
/**
|
|
148
|
-
* Stop listening in on a single workflow topic
|
|
149
|
-
*/
|
|
150
|
-
unsub(topic: string): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* Listen to all output and interim emissions of a workflow topic
|
|
153
|
-
* matching a wildcard pattern.
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* await hotMesh.psub('a.b.c*', (topic, message) => {
|
|
157
|
-
* console.log(message);
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
psub(wild: string, callback: JobMessageCallback): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Patterned unsubscribe. NOTE: Postgres does not support patterned
|
|
164
|
-
* unsubscription, so this method is not supported for Postgres.
|
|
165
|
-
*/
|
|
166
|
-
punsub(wild: string): Promise<void>;
|
|
167
|
-
/**
|
|
168
|
-
* Starts a workflow and awaits the response
|
|
169
|
-
* @example
|
|
170
|
-
* ```typescript
|
|
171
|
-
* await hotMesh.pubsub('a.b.c', { key: 'value' });
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
pubsub(topic: string, data?: JobData, context?: JobState | null, timeout?: number): Promise<JobOutput>;
|
|
175
|
-
/**
|
|
176
|
-
* Add a transition message to the workstream, resuming leg 2 of a paused
|
|
177
|
-
* reentrant activity (e.g., await, worker, hook)
|
|
178
|
-
*/
|
|
179
|
-
add(streamData: StreamData | StreamDataResponse): Promise<string>;
|
|
180
|
-
/**
|
|
181
|
-
* Request a roll call from the quorum (engine and workers)
|
|
182
|
-
*/
|
|
183
|
-
rollCall(delay?: number): Promise<QuorumProfile[]>;
|
|
184
|
-
/**
|
|
185
|
-
* Sends a throttle message to the quorum (engine and/or workers)
|
|
186
|
-
* to limit the rate of processing. Pass `-1` to throttle indefinitely.
|
|
187
|
-
* The value must be a non-negative integer and not exceed `MAX_DELAY` ms.
|
|
188
|
-
*
|
|
189
|
-
* When throttling is set, the quorum will pause for the specified time
|
|
190
|
-
* before processing the next message. Target specific engines and
|
|
191
|
-
* workers by passing a `guid` and/or `topic`. Pass no arguments to
|
|
192
|
-
* throttle the entire quorum.
|
|
193
|
-
*
|
|
194
|
-
* In this example, all processing has been paused indefinitely for
|
|
195
|
-
* the entire quorum. This is equivalent to an emergency stop.
|
|
196
|
-
*
|
|
197
|
-
* HotMesh is a stateless sequence engine, so the throttle can be adjusted up
|
|
198
|
-
* and down with no loss of data.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```typescript
|
|
203
|
-
* await hotMesh.throttle({ throttle: -1 });
|
|
204
|
-
* ```
|
|
205
|
-
*/
|
|
206
|
-
throttle(options: ThrottleOptions): Promise<boolean>;
|
|
207
|
-
/**
|
|
208
|
-
* Publish a message to the quorum (engine and/or workers)
|
|
209
|
-
*/
|
|
210
|
-
pubQuorum(quorumMessage: QuorumMessage): Promise<boolean>;
|
|
211
|
-
/**
|
|
212
|
-
* Subscribe to quorum events (engine and workers)
|
|
213
|
-
*/
|
|
214
|
-
subQuorum(callback: QuorumMessageCallback): Promise<void>;
|
|
215
|
-
/**
|
|
216
|
-
* Unsubscribe from quorum events (engine and workers)
|
|
217
|
-
*/
|
|
218
|
-
unsubQuorum(callback: QuorumMessageCallback): Promise<void>;
|
|
219
|
-
/**
|
|
220
|
-
* Preview changes and provide an analysis of risk
|
|
221
|
-
* prior to deployment
|
|
222
|
-
* @private
|
|
223
|
-
*/
|
|
224
|
-
plan(path: string): Promise<HotMeshManifest>;
|
|
225
|
-
/**
|
|
226
|
-
* When the app YAML descriptor file is ready, the `deploy` function can be called.
|
|
227
|
-
* This function is responsible for merging all referenced YAML source
|
|
228
|
-
* files and writing the JSON output to the file system and to the provider backend. It
|
|
229
|
-
* is also possible to embed the YAML in-line as a string.
|
|
230
|
-
*
|
|
231
|
-
* *The version will not be active until activation is explicitly called.*
|
|
232
|
-
*/
|
|
233
|
-
deploy(pathOrYAML: string): Promise<HotMeshManifest>;
|
|
234
|
-
/**
|
|
235
|
-
* Once the app YAML file is deployed to the provider backend, the `activate` function can be
|
|
236
|
-
* called to enable it for the entire quorum at the same moment.
|
|
237
|
-
*
|
|
238
|
-
* The approach is to establish the coordinated health of the system through series
|
|
239
|
-
* of call/response exchanges. Once it is established that the quorum is healthy,
|
|
240
|
-
* the quorum is instructed to run their engine in `no-cache` mode, ensuring
|
|
241
|
-
* that the provider backend is consulted for the active app version each time a
|
|
242
|
-
* call is processed. This ensures that all engines are running the same version
|
|
243
|
-
* of the app, switching over at the same moment and then enabling `cache` mode
|
|
244
|
-
* to improve performance.
|
|
245
|
-
*
|
|
246
|
-
* *Add a delay for the quorum to reach consensus if traffic is busy, but
|
|
247
|
-
* also consider throttling traffic flow to an acceptable level.*
|
|
248
|
-
*/
|
|
249
|
-
activate(version: string, delay?: number): Promise<boolean>;
|
|
250
|
-
/**
|
|
251
|
-
* Returns the job state as a JSON object, useful
|
|
252
|
-
* for understanding dependency chains
|
|
253
|
-
*/
|
|
254
|
-
export(jobId: string): Promise<JobExport>;
|
|
255
|
-
/**
|
|
256
|
-
* Returns all data (HGETALL) for a job.
|
|
257
|
-
*/
|
|
258
|
-
getRaw(jobId: string): Promise<StringStringType>;
|
|
259
|
-
/**
|
|
260
|
-
* Reporter-related method to get the status of a job
|
|
261
|
-
* @private
|
|
262
|
-
*/
|
|
263
|
-
getStats(topic: string, query: JobStatsInput): Promise<StatsResponse>;
|
|
264
|
-
/**
|
|
265
|
-
* Returns the status of a job. This is a numeric
|
|
266
|
-
* semaphore value that indicates the job's state.
|
|
267
|
-
* Any non-positive value indicates a completed job.
|
|
268
|
-
* Jobs with a value of `-1` are pending and will
|
|
269
|
-
* automatically be scrubbed after a set period.
|
|
270
|
-
* Jobs a value around -1billion have been interrupted
|
|
271
|
-
* and will be scrubbed after a set period. Jobs with
|
|
272
|
-
* a value of 0 completed normally. Jobs with a
|
|
273
|
-
* positive value are still running.
|
|
274
|
-
*/
|
|
275
|
-
getStatus(jobId: string): Promise<JobStatus>;
|
|
276
|
-
/**
|
|
277
|
-
* Returns the job state (data and metadata) for a job.
|
|
278
|
-
*/
|
|
279
|
-
getState(topic: string, jobId: string): Promise<JobOutput>;
|
|
280
|
-
/**
|
|
281
|
-
* Returns searchable/queryable data for a job. In this
|
|
282
|
-
* example a literal field is also searched (the colon
|
|
283
|
-
* is used to track job status and is a reserved field;
|
|
284
|
-
* it can be read but not written).
|
|
285
|
-
*
|
|
286
|
-
* @example
|
|
287
|
-
* ```typescript
|
|
288
|
-
* const fields = ['fred', 'barney', '":"'];
|
|
289
|
-
* const queryState = await hotMesh.getQueryState('123', fields);
|
|
290
|
-
* //returns { fred: 'flintstone', barney: 'rubble', ':': '1' }
|
|
291
|
-
* ```
|
|
292
|
-
*/
|
|
293
|
-
getQueryState(jobId: string, fields: string[]): Promise<StringAnyType>;
|
|
294
|
-
/**
|
|
295
|
-
* @private
|
|
296
|
-
*/
|
|
297
|
-
getIds(topic: string, query: JobStatsInput, queryFacets?: any[]): Promise<IdsResponse>;
|
|
298
|
-
/**
|
|
299
|
-
* @private
|
|
300
|
-
*/
|
|
301
|
-
resolveQuery(topic: string, query: JobStatsInput): Promise<GetStatsOptions>;
|
|
302
|
-
/**
|
|
303
|
-
* Interrupt an active job
|
|
304
|
-
*/
|
|
305
|
-
interrupt(topic: string, jobId: string, options?: JobInterruptOptions): Promise<string>;
|
|
306
|
-
/**
|
|
307
|
-
* Immediately deletes (DEL) a completed job from the system.
|
|
308
|
-
*
|
|
309
|
-
* *Scrubbed jobs must be complete with a non-positive `status` value*
|
|
310
|
-
*/
|
|
311
|
-
scrub(jobId: string): Promise<void>;
|
|
312
|
-
/**
|
|
313
|
-
* Re/entry point for an active job. This is used to resume a paused job
|
|
314
|
-
* and close the reentry point or leave it open for subsequent reentry.
|
|
315
|
-
* Because `hooks` are public entry points, they include a `topic`
|
|
316
|
-
* which is established in the app YAML file.
|
|
317
|
-
*
|
|
318
|
-
* When this method is called, a hook rule will be located to establish
|
|
319
|
-
* the exact activity and activity dimension for reentry.
|
|
320
|
-
*/
|
|
321
|
-
hook(topic: string, data: JobData, status?: StreamStatus, code?: StreamCode): Promise<string>;
|
|
322
|
-
/**
|
|
323
|
-
* @private
|
|
324
|
-
*/
|
|
325
|
-
hookAll(hookTopic: string, data: JobData, query: JobStatsInput, queryFacets?: string[]): Promise<string[]>;
|
|
326
|
-
/**
|
|
327
|
-
* Stop all points of presence, workers and engines
|
|
328
|
-
*/
|
|
329
|
-
static stop(): Promise<void>;
|
|
330
|
-
/**
|
|
331
|
-
* Stop this point of presence, workers and engines
|
|
332
|
-
*/
|
|
333
|
-
stop(): void;
|
|
334
|
-
/**
|
|
335
|
-
* @private
|
|
336
|
-
* @deprecated
|
|
337
|
-
*/
|
|
338
|
-
compress(terms: string[]): Promise<boolean>;
|
|
339
|
-
}
|
|
340
|
-
export { HotMesh };
|