@hotmeshio/hotmesh 0.0.1
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/LICENSE +214 -0
- package/README.md +241 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +7 -0
- package/build/modules/errors.d.ts +28 -0
- package/build/modules/errors.js +50 -0
- package/build/modules/key.d.ts +75 -0
- package/build/modules/key.js +116 -0
- package/build/modules/utils.d.ts +34 -0
- package/build/modules/utils.js +173 -0
- package/build/package.json +73 -0
- package/build/services/activities/activity.d.ts +59 -0
- package/build/services/activities/activity.js +396 -0
- package/build/services/activities/await.d.ts +16 -0
- package/build/services/activities/await.js +143 -0
- package/build/services/activities/emit.d.ts +9 -0
- package/build/services/activities/emit.js +13 -0
- package/build/services/activities/index.d.ts +15 -0
- package/build/services/activities/index.js +16 -0
- package/build/services/activities/iterate.d.ts +9 -0
- package/build/services/activities/iterate.js +13 -0
- package/build/services/activities/trigger.d.ts +22 -0
- package/build/services/activities/trigger.js +161 -0
- package/build/services/activities/worker.d.ts +17 -0
- package/build/services/activities/worker.js +164 -0
- package/build/services/collator/index.d.ts +54 -0
- package/build/services/collator/index.js +171 -0
- package/build/services/compiler/deployer.d.ts +35 -0
- package/build/services/compiler/deployer.js +412 -0
- package/build/services/compiler/index.d.ts +30 -0
- package/build/services/compiler/index.js +111 -0
- package/build/services/compiler/validator.d.ts +32 -0
- package/build/services/compiler/validator.js +134 -0
- package/build/services/connector/clients/ioredis.d.ts +13 -0
- package/build/services/connector/clients/ioredis.js +50 -0
- package/build/services/connector/clients/redis.d.ts +13 -0
- package/build/services/connector/clients/redis.js +62 -0
- package/build/services/connector/index.d.ts +5 -0
- package/build/services/connector/index.js +31 -0
- package/build/services/dimension/index.d.ts +29 -0
- package/build/services/dimension/index.js +35 -0
- package/build/services/durable/asyncLocalStorage.d.ts +3 -0
- package/build/services/durable/asyncLocalStorage.js +5 -0
- package/build/services/durable/client.d.ts +15 -0
- package/build/services/durable/client.js +108 -0
- package/build/services/durable/connection.d.ts +4 -0
- package/build/services/durable/connection.js +51 -0
- package/build/services/durable/factory.d.ts +3 -0
- package/build/services/durable/factory.js +123 -0
- package/build/services/durable/handle.d.ts +8 -0
- package/build/services/durable/handle.js +38 -0
- package/build/services/durable/index.d.ts +57 -0
- package/build/services/durable/index.js +58 -0
- package/build/services/durable/native.d.ts +4 -0
- package/build/services/durable/native.js +47 -0
- package/build/services/durable/worker.d.ts +36 -0
- package/build/services/durable/worker.js +266 -0
- package/build/services/durable/workflow.d.ts +6 -0
- package/build/services/durable/workflow.js +135 -0
- package/build/services/engine/index.d.ts +82 -0
- package/build/services/engine/index.js +511 -0
- package/build/services/hotmesh/index.d.ts +45 -0
- package/build/services/hotmesh/index.js +134 -0
- package/build/services/logger/index.d.ts +17 -0
- package/build/services/logger/index.js +73 -0
- package/build/services/mapper/index.d.ts +24 -0
- package/build/services/mapper/index.js +72 -0
- package/build/services/pipe/functions/array.d.ts +24 -0
- package/build/services/pipe/functions/array.js +69 -0
- package/build/services/pipe/functions/bitwise.d.ts +9 -0
- package/build/services/pipe/functions/bitwise.js +24 -0
- package/build/services/pipe/functions/conditional.d.ts +10 -0
- package/build/services/pipe/functions/conditional.js +27 -0
- package/build/services/pipe/functions/date.d.ts +57 -0
- package/build/services/pipe/functions/date.js +167 -0
- package/build/services/pipe/functions/index.d.ts +25 -0
- package/build/services/pipe/functions/index.js +26 -0
- package/build/services/pipe/functions/json.d.ts +5 -0
- package/build/services/pipe/functions/json.js +12 -0
- package/build/services/pipe/functions/math.d.ts +38 -0
- package/build/services/pipe/functions/math.js +111 -0
- package/build/services/pipe/functions/number.d.ts +25 -0
- package/build/services/pipe/functions/number.js +133 -0
- package/build/services/pipe/functions/object.d.ts +22 -0
- package/build/services/pipe/functions/object.js +63 -0
- package/build/services/pipe/functions/string.d.ts +23 -0
- package/build/services/pipe/functions/string.js +69 -0
- package/build/services/pipe/functions/symbol.d.ts +12 -0
- package/build/services/pipe/functions/symbol.js +33 -0
- package/build/services/pipe/functions/unary.d.ts +7 -0
- package/build/services/pipe/functions/unary.js +18 -0
- package/build/services/pipe/index.d.ts +30 -0
- package/build/services/pipe/index.js +128 -0
- package/build/services/quorum/index.d.ts +34 -0
- package/build/services/quorum/index.js +147 -0
- package/build/services/reporter/index.d.ts +47 -0
- package/build/services/reporter/index.js +330 -0
- package/build/services/serializer/index.d.ts +36 -0
- package/build/services/serializer/index.js +222 -0
- package/build/services/signaler/store.d.ts +15 -0
- package/build/services/signaler/store.js +53 -0
- package/build/services/signaler/stream.d.ts +43 -0
- package/build/services/signaler/stream.js +317 -0
- package/build/services/store/cache.d.ts +66 -0
- package/build/services/store/cache.js +127 -0
- package/build/services/store/clients/ioredis.d.ts +27 -0
- package/build/services/store/clients/ioredis.js +96 -0
- package/build/services/store/clients/redis.d.ts +29 -0
- package/build/services/store/clients/redis.js +143 -0
- package/build/services/store/index.d.ts +88 -0
- package/build/services/store/index.js +657 -0
- package/build/services/stream/clients/ioredis.d.ts +23 -0
- package/build/services/stream/clients/ioredis.js +115 -0
- package/build/services/stream/clients/redis.d.ts +23 -0
- package/build/services/stream/clients/redis.js +119 -0
- package/build/services/stream/index.d.ts +21 -0
- package/build/services/stream/index.js +9 -0
- package/build/services/sub/clients/ioredis.d.ts +20 -0
- package/build/services/sub/clients/ioredis.js +72 -0
- package/build/services/sub/clients/redis.d.ts +20 -0
- package/build/services/sub/clients/redis.js +63 -0
- package/build/services/sub/index.d.ts +18 -0
- package/build/services/sub/index.js +9 -0
- package/build/services/task/index.d.ts +18 -0
- package/build/services/task/index.js +73 -0
- package/build/services/telemetry/index.d.ts +49 -0
- package/build/services/telemetry/index.js +223 -0
- package/build/services/worker/index.d.ts +30 -0
- package/build/services/worker/index.js +105 -0
- package/build/types/activity.d.ts +86 -0
- package/build/types/activity.js +2 -0
- package/build/types/app.d.ts +16 -0
- package/build/types/app.js +2 -0
- package/build/types/async.d.ts +5 -0
- package/build/types/async.js +2 -0
- package/build/types/cache.d.ts +1 -0
- package/build/types/cache.js +2 -0
- package/build/types/collator.d.ts +8 -0
- package/build/types/collator.js +11 -0
- package/build/types/durable.d.ts +59 -0
- package/build/types/durable.js +2 -0
- package/build/types/hook.d.ts +31 -0
- package/build/types/hook.js +9 -0
- package/build/types/hotmesh.d.ts +82 -0
- package/build/types/hotmesh.js +2 -0
- package/build/types/index.d.ts +20 -0
- package/build/types/index.js +21 -0
- package/build/types/ioredisclient.d.ts +5 -0
- package/build/types/ioredisclient.js +5 -0
- package/build/types/job.d.ts +50 -0
- package/build/types/job.js +2 -0
- package/build/types/logger.d.ts +6 -0
- package/build/types/logger.js +2 -0
- package/build/types/map.d.ts +4 -0
- package/build/types/map.js +2 -0
- package/build/types/pipe.d.ts +4 -0
- package/build/types/pipe.js +2 -0
- package/build/types/quorum.d.ts +46 -0
- package/build/types/quorum.js +2 -0
- package/build/types/redis.d.ts +8 -0
- package/build/types/redis.js +2 -0
- package/build/types/redisclient.d.ts +25 -0
- package/build/types/redisclient.js +2 -0
- package/build/types/serializer.d.ts +33 -0
- package/build/types/serializer.js +2 -0
- package/build/types/stats.d.ts +83 -0
- package/build/types/stats.js +2 -0
- package/build/types/stream.d.ts +67 -0
- package/build/types/stream.js +25 -0
- package/build/types/telemetry.d.ts +1 -0
- package/build/types/telemetry.js +11 -0
- package/build/types/transition.d.ts +17 -0
- package/build/types/transition.js +2 -0
- package/index.ts +5 -0
- package/modules/errors.ts +55 -0
- package/modules/key.ts +129 -0
- package/modules/utils.ts +170 -0
- package/package.json +73 -0
- package/services/activities/activity.ts +473 -0
- package/services/activities/await.ts +172 -0
- package/services/activities/emit.ts +25 -0
- package/services/activities/index.ts +15 -0
- package/services/activities/iterate.ts +26 -0
- package/services/activities/trigger.ts +196 -0
- package/services/activities/worker.ts +190 -0
- package/services/collator/README.md +102 -0
- package/services/collator/index.ts +182 -0
- package/services/compiler/deployer.ts +432 -0
- package/services/compiler/index.ts +98 -0
- package/services/compiler/validator.ts +154 -0
- package/services/connector/clients/ioredis.ts +57 -0
- package/services/connector/clients/redis.ts +72 -0
- package/services/connector/index.ts +44 -0
- package/services/dimension/README.md +73 -0
- package/services/dimension/index.ts +39 -0
- package/services/durable/asyncLocalStorage.ts +3 -0
- package/services/durable/client.ts +116 -0
- package/services/durable/connection.ts +50 -0
- package/services/durable/factory.ts +124 -0
- package/services/durable/handle.ts +43 -0
- package/services/durable/index.ts +60 -0
- package/services/durable/native.ts +46 -0
- package/services/durable/worker.ts +254 -0
- package/services/durable/workflow.ts +136 -0
- package/services/engine/index.ts +615 -0
- package/services/hotmesh/index.ts +182 -0
- package/services/logger/index.ts +79 -0
- package/services/mapper/index.ts +84 -0
- package/services/pipe/functions/array.ts +87 -0
- package/services/pipe/functions/bitwise.ts +27 -0
- package/services/pipe/functions/conditional.ts +31 -0
- package/services/pipe/functions/date.ts +214 -0
- package/services/pipe/functions/index.ts +25 -0
- package/services/pipe/functions/json.ts +11 -0
- package/services/pipe/functions/math.ts +143 -0
- package/services/pipe/functions/number.ts +150 -0
- package/services/pipe/functions/object.ts +79 -0
- package/services/pipe/functions/string.ts +86 -0
- package/services/pipe/functions/symbol.ts +39 -0
- package/services/pipe/functions/unary.ts +19 -0
- package/services/pipe/index.ts +138 -0
- package/services/quorum/index.ts +200 -0
- package/services/reporter/index.ts +379 -0
- package/services/serializer/README.md +10 -0
- package/services/serializer/index.ts +243 -0
- package/services/signaler/store.ts +61 -0
- package/services/signaler/stream.ts +354 -0
- package/services/store/cache.ts +172 -0
- package/services/store/clients/ioredis.ts +123 -0
- package/services/store/clients/redis.ts +169 -0
- package/services/store/index.ts +757 -0
- package/services/stream/clients/ioredis.ts +148 -0
- package/services/stream/clients/redis.ts +144 -0
- package/services/stream/index.ts +57 -0
- package/services/sub/clients/ioredis.ts +83 -0
- package/services/sub/clients/redis.ts +74 -0
- package/services/sub/index.ts +25 -0
- package/services/task/index.ts +86 -0
- package/services/telemetry/index.ts +267 -0
- package/services/worker/index.ts +165 -0
- package/types/activity.ts +115 -0
- package/types/app.ts +20 -0
- package/types/async.ts +7 -0
- package/types/cache.ts +1 -0
- package/types/collator.ts +9 -0
- package/types/durable.ts +81 -0
- package/types/hook.ts +32 -0
- package/types/hotmesh.ts +102 -0
- package/types/index.ts +138 -0
- package/types/ioredisclient.ts +10 -0
- package/types/job.ts +59 -0
- package/types/logger.ts +6 -0
- package/types/map.ts +5 -0
- package/types/ms.d.ts +7 -0
- package/types/pipe.ts +7 -0
- package/types/quorum.ts +59 -0
- package/types/redis.ts +27 -0
- package/types/redisclient.ts +29 -0
- package/types/serializer.ts +38 -0
- package/types/stats.ts +100 -0
- package/types/stream.ts +75 -0
- package/types/telemetry.ts +15 -0
- package/types/transition.ts +20 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WorkflowService = void 0;
|
|
7
|
+
const ms_1 = __importDefault(require("ms"));
|
|
8
|
+
const asyncLocalStorage_1 = require("./asyncLocalStorage");
|
|
9
|
+
const worker_1 = require("./worker");
|
|
10
|
+
const client_1 = require("./client");
|
|
11
|
+
const connection_1 = require("./connection");
|
|
12
|
+
/*
|
|
13
|
+
`proxyActivities` returns a wrapped instance of the
|
|
14
|
+
target activity, so that when the workflow calls a
|
|
15
|
+
proxied activity, it is actually calling the proxy
|
|
16
|
+
function, which in turn calls the activity function.
|
|
17
|
+
|
|
18
|
+
`proxyActivities` must be called AFTER the activities
|
|
19
|
+
have been registered in order to work properly.
|
|
20
|
+
If the activities are not already registered,
|
|
21
|
+
`proxyActivities` will throw an error. This is OK.
|
|
22
|
+
|
|
23
|
+
The `client` (client.ts) is equivalent to the
|
|
24
|
+
HotMesh `engine`. The jobs it creates will be
|
|
25
|
+
put in the taskQueue. When the `worker` (worker.ts)
|
|
26
|
+
is eventually initialized (if it happens to be inited later),
|
|
27
|
+
it will see the items in the queue and process them. If it happens
|
|
28
|
+
to already be inited, the jobs will immediately be dequeued and
|
|
29
|
+
processed. In either case, the jobs will be processed.
|
|
30
|
+
|
|
31
|
+
Here is an example of how the methods in this file are used:
|
|
32
|
+
|
|
33
|
+
./workflows.ts
|
|
34
|
+
|
|
35
|
+
import { Durable } from '@hotmeshio/hotmesh';
|
|
36
|
+
import type * as activities from './activities';
|
|
37
|
+
const { greet } = Durable.workflow.proxyActivities<typeof activities>({
|
|
38
|
+
startToCloseTimeout: '1 minute',
|
|
39
|
+
retryPolicy: {
|
|
40
|
+
initialInterval: '5 seconds', // Initial delay between retries
|
|
41
|
+
maximumAttempts: 3, // Max number of retry attempts
|
|
42
|
+
backoffCoefficient: 2.0, // Backoff factor for delay between retries: delay = initialInterval * (backoffCoefficient ^ retry_attempt)
|
|
43
|
+
maximumInterval: '30 seconds', // Max delay between retries
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export async function example(name: string): Promise<string> {
|
|
48
|
+
return await greet(name);
|
|
49
|
+
}
|
|
50
|
+
*/
|
|
51
|
+
class WorkflowService {
|
|
52
|
+
static async executeChild(options) {
|
|
53
|
+
const store = asyncLocalStorage_1.asyncLocalStorage.getStore();
|
|
54
|
+
if (!store) {
|
|
55
|
+
throw new Error('durable-store-not-found');
|
|
56
|
+
}
|
|
57
|
+
const workflowId = store.get('workflowId');
|
|
58
|
+
const workflowTrace = store.get('workflowTrace');
|
|
59
|
+
const workflowSpan = store.get('workflowSpan');
|
|
60
|
+
const client = new client_1.ClientService({
|
|
61
|
+
connection: await connection_1.ConnectionService.connect(worker_1.WorkerService.connection),
|
|
62
|
+
});
|
|
63
|
+
//todo: should I allow-cross/app callback (pj:'@DURABLE@hello-world@<pjid>'/pa: <paid>/pd: <pdad>)
|
|
64
|
+
const handle = await client.workflow.start({
|
|
65
|
+
...options,
|
|
66
|
+
workflowId: `${workflowId}${options.workflowId}`,
|
|
67
|
+
workflowTrace,
|
|
68
|
+
workflowSpan,
|
|
69
|
+
});
|
|
70
|
+
const result = await handle.result();
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
static proxyActivities(options) {
|
|
74
|
+
const proxy = {};
|
|
75
|
+
const keys = Object.keys(worker_1.WorkerService.activityRegistry);
|
|
76
|
+
if (keys.length) {
|
|
77
|
+
keys.forEach((key) => {
|
|
78
|
+
const activityFunction = worker_1.WorkerService.activityRegistry[key];
|
|
79
|
+
proxy[key] = WorkflowService.wrapActivity(key, options);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return proxy;
|
|
83
|
+
}
|
|
84
|
+
static wrapActivity(activityName, options) {
|
|
85
|
+
return async function () {
|
|
86
|
+
const store = asyncLocalStorage_1.asyncLocalStorage.getStore();
|
|
87
|
+
if (!store) {
|
|
88
|
+
throw new Error('durable-store-not-found');
|
|
89
|
+
}
|
|
90
|
+
const COUNTER = store.get('counter');
|
|
91
|
+
//increment by state (not value) to avoid race conditions
|
|
92
|
+
const execIndex = COUNTER.counter = COUNTER.counter + 1;
|
|
93
|
+
const workflowId = store.get('workflowId');
|
|
94
|
+
const workflowTopic = store.get('workflowTopic');
|
|
95
|
+
const trc = store.get('workflowTrace');
|
|
96
|
+
const spn = store.get('workflowSpan');
|
|
97
|
+
const activityTopic = `${workflowTopic}-activity`;
|
|
98
|
+
const activityJobId = `${workflowId}-${activityName}-${execIndex}`;
|
|
99
|
+
let activityState;
|
|
100
|
+
try {
|
|
101
|
+
const hmshInstance = await worker_1.WorkerService.getHotMesh(activityTopic);
|
|
102
|
+
activityState = await hmshInstance.getState(activityTopic, activityJobId);
|
|
103
|
+
if (activityState.metadata.js == 1) {
|
|
104
|
+
//return immediately
|
|
105
|
+
return activityState.data?.response;
|
|
106
|
+
}
|
|
107
|
+
//one time subscription
|
|
108
|
+
return await new Promise((resolve, reject) => {
|
|
109
|
+
hmshInstance.sub(activityTopic, async (topic, message) => {
|
|
110
|
+
const response = message.data?.response;
|
|
111
|
+
hmshInstance.unsub(activityTopic);
|
|
112
|
+
// Resolve the Promise when the callback is triggered with a message
|
|
113
|
+
resolve(response);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
//expected; thrown by `getState` when the job cannot be found
|
|
119
|
+
const duration = (0, ms_1.default)(options?.startToCloseTimeout || '1 minute');
|
|
120
|
+
const payload = {
|
|
121
|
+
arguments: Array.from(arguments),
|
|
122
|
+
workflowId: activityJobId,
|
|
123
|
+
workflowTopic,
|
|
124
|
+
activityName,
|
|
125
|
+
};
|
|
126
|
+
//start the job
|
|
127
|
+
const hmshInstance = await worker_1.WorkerService.getHotMesh(activityTopic);
|
|
128
|
+
const context = { metadata: { trc, spn }, data: {} };
|
|
129
|
+
const jobOutput = await hmshInstance.pubsub(activityTopic, payload, context, duration);
|
|
130
|
+
return jobOutput.data.response;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.WorkflowService = WorkflowService;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Activity } from '../activities/activity';
|
|
2
|
+
import { ILogger } from '../logger';
|
|
3
|
+
import { StoreSignaler } from '../signaler/store';
|
|
4
|
+
import { StreamSignaler } from '../signaler/stream';
|
|
5
|
+
import { StoreService } from '../store';
|
|
6
|
+
import { StreamService } from '../stream';
|
|
7
|
+
import { SubService } from '../sub';
|
|
8
|
+
import { TaskService } from '../task';
|
|
9
|
+
import { AppVID } from '../../types/app';
|
|
10
|
+
import { ActivityType } from '../../types/activity';
|
|
11
|
+
import { CacheMode } from '../../types/cache';
|
|
12
|
+
import { JobState, JobData, JobMetadata, JobOutput, JobStatus } from '../../types/job';
|
|
13
|
+
import { HotMeshApps, HotMeshConfig, HotMeshManifest, HotMeshSettings } from '../../types/hotmesh';
|
|
14
|
+
import { JobMessageCallback } from '../../types/quorum';
|
|
15
|
+
import { RedisClient, RedisMulti } from '../../types/redis';
|
|
16
|
+
import { GetStatsOptions, IdsResponse, JobStatsInput, StatsResponse } from '../../types/stats';
|
|
17
|
+
import { StreamData, StreamDataResponse, StreamError } from '../../types/stream';
|
|
18
|
+
declare class EngineService {
|
|
19
|
+
namespace: string;
|
|
20
|
+
apps: HotMeshApps | null;
|
|
21
|
+
appId: string;
|
|
22
|
+
guid: string;
|
|
23
|
+
store: StoreService<RedisClient, RedisMulti> | null;
|
|
24
|
+
stream: StreamService<RedisClient, RedisMulti> | null;
|
|
25
|
+
subscribe: SubService<RedisClient, RedisMulti> | null;
|
|
26
|
+
storeSignaler: StoreSignaler | null;
|
|
27
|
+
streamSignaler: StreamSignaler | null;
|
|
28
|
+
task: TaskService | null;
|
|
29
|
+
logger: ILogger;
|
|
30
|
+
cacheMode: CacheMode;
|
|
31
|
+
untilVersion: string | null;
|
|
32
|
+
jobCallbacks: Record<string, JobMessageCallback>;
|
|
33
|
+
reporting: boolean;
|
|
34
|
+
jobId: number;
|
|
35
|
+
static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<EngineService>;
|
|
36
|
+
verifyEngineFields(config: HotMeshConfig): void;
|
|
37
|
+
initStoreChannel(store: RedisClient): Promise<void>;
|
|
38
|
+
initSubChannel(sub: RedisClient): Promise<void>;
|
|
39
|
+
initStreamChannel(stream: RedisClient): Promise<void>;
|
|
40
|
+
initStreamSignaler(config: HotMeshConfig): StreamSignaler;
|
|
41
|
+
getVID(vid?: AppVID): Promise<AppVID>;
|
|
42
|
+
setCacheMode(cacheMode: CacheMode, untilVersion: string): void;
|
|
43
|
+
routeToSubscribers(topic: string, message: JobOutput): Promise<void>;
|
|
44
|
+
processWebHooks(): Promise<void>;
|
|
45
|
+
processTimeHooks(): Promise<void>;
|
|
46
|
+
throttle(delayInMillis: number): Promise<void>;
|
|
47
|
+
initActivity(topic: string, data?: JobData, context?: JobState): Promise<Activity>;
|
|
48
|
+
getSchema(topic: string): Promise<[activityId: string, schema: ActivityType]>;
|
|
49
|
+
getSettings(): Promise<HotMeshSettings>;
|
|
50
|
+
isPrivate(topic: string): boolean;
|
|
51
|
+
plan(pathOrYAML: string): Promise<HotMeshManifest>;
|
|
52
|
+
deploy(pathOrYAML: string): Promise<HotMeshManifest>;
|
|
53
|
+
getStats(topic: string, query: JobStatsInput): Promise<StatsResponse>;
|
|
54
|
+
getIds(topic: string, query: JobStatsInput, queryFacets?: any[]): Promise<IdsResponse>;
|
|
55
|
+
resolveQuery(topic: string, query: JobStatsInput): Promise<GetStatsOptions>;
|
|
56
|
+
processStreamMessage(streamData: StreamDataResponse): Promise<void>;
|
|
57
|
+
execAdjacentParent(context: JobState, jobOutput: JobOutput): Promise<string>;
|
|
58
|
+
hasParentJob(context: JobState): boolean;
|
|
59
|
+
resolveError(metadata: JobMetadata): StreamError | undefined;
|
|
60
|
+
scrub(jobId: string): Promise<void>;
|
|
61
|
+
hook(topic: string, data: JobData): Promise<JobStatus | void>;
|
|
62
|
+
hookTime(jobId: string, activityId: string): Promise<JobStatus | void>;
|
|
63
|
+
hookAll(hookTopic: string, data: JobData, query: JobStatsInput, queryFacets?: string[]): Promise<string[]>;
|
|
64
|
+
pub(topic: string, data: JobData, context?: JobState): Promise<string>;
|
|
65
|
+
sub(topic: string, callback: JobMessageCallback): Promise<void>;
|
|
66
|
+
unsub(topic: string): Promise<void>;
|
|
67
|
+
psub(wild: string, callback: JobMessageCallback): Promise<void>;
|
|
68
|
+
punsub(wild: string): Promise<void>;
|
|
69
|
+
pubsub(topic: string, data: JobData, context?: JobState | null, timeout?: number): Promise<JobOutput>;
|
|
70
|
+
resolveOneTimeSubscription(context: JobState, jobOutput: JobOutput): Promise<void>;
|
|
71
|
+
getPublishesTopic(context: JobState): Promise<string>;
|
|
72
|
+
resolvePersistentSubscriptions(context: JobState, jobOutput: JobOutput): Promise<void>;
|
|
73
|
+
add(streamData: StreamData | StreamDataResponse): Promise<string>;
|
|
74
|
+
registerJobCallback(jobId: string, jobCallback: JobMessageCallback): void;
|
|
75
|
+
delistJobCallback(jobId: string): void;
|
|
76
|
+
hasOneTimeSubscription(context: JobState): boolean;
|
|
77
|
+
runJobCompletionTasks(context: JobState): Promise<void>;
|
|
78
|
+
getStatus(jobId: string): Promise<JobStatus>;
|
|
79
|
+
getState(topic: string, jobId: string): Promise<JobOutput>;
|
|
80
|
+
compress(terms: string[]): Promise<boolean>;
|
|
81
|
+
}
|
|
82
|
+
export { EngineService };
|