@hotmeshio/hotmesh 0.0.21 → 0.0.23
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 +0 -3
- package/build/package.json +2 -1
- package/build/services/durable/connection.js +0 -39
- package/build/services/durable/factory.d.ts +6 -4
- package/build/services/durable/factory.js +6 -4
- package/build/services/durable/handle.d.ts +3 -0
- package/build/services/durable/handle.js +14 -2
- package/build/services/durable/index.d.ts +2 -45
- package/build/services/durable/index.js +2 -45
- package/build/services/durable/meshdb.d.ts +113 -0
- package/build/services/durable/meshdb.js +211 -0
- package/build/services/durable/search.d.ts +9 -0
- package/build/services/durable/search.js +35 -2
- package/build/services/durable/worker.d.ts +1 -9
- package/build/services/durable/worker.js +2 -35
- package/build/services/durable/workflow.d.ts +8 -1
- package/build/services/durable/workflow.js +15 -16
- package/build/services/engine/index.d.ts +2 -0
- package/build/services/engine/index.js +3 -0
- package/build/services/hotmesh/index.d.ts +3 -1
- package/build/services/hotmesh/index.js +5 -2
- package/build/services/store/index.d.ts +5 -0
- package/build/services/store/index.js +14 -0
- package/build/types/durable.d.ts +20 -4
- package/build/types/index.d.ts +1 -1
- package/package.json +2 -1
- package/services/durable/connection.ts +0 -40
- package/services/durable/factory.ts +6 -4
- package/services/durable/handle.ts +17 -2
- package/services/durable/index.ts +2 -46
- package/services/durable/meshdb.ts +254 -0
- package/services/durable/search.ts +36 -2
- package/services/durable/worker.ts +3 -37
- package/services/durable/workflow.ts +15 -15
- package/services/engine/index.ts +4 -1
- package/services/hotmesh/index.ts +6 -2
- package/services/store/index.ts +15 -0
- package/types/durable.ts +20 -4
- package/types/index.ts +2 -1
- package/build/services/durable/native.d.ts +0 -4
- package/build/services/durable/native.js +0 -46
- package/services/durable/native.ts +0 -45
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Connection, ConnectionConfig } from "../../types/durable";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
|
|
5
|
-
Here is an example of how the methods in this file are used:
|
|
6
|
-
|
|
7
|
-
./worker.ts
|
|
8
|
-
|
|
9
|
-
import { Durable: { NativeConnection, Worker } } from '@hotmeshio/hotmesh';
|
|
10
|
-
import Redis from 'ioredis'; //OR `import * as Redis from 'redis';`
|
|
11
|
-
|
|
12
|
-
import * as workflows from './workflows';
|
|
13
|
-
|
|
14
|
-
async function run() {
|
|
15
|
-
const connection = await NativeConnection.connect({
|
|
16
|
-
class: Redis,
|
|
17
|
-
options: {
|
|
18
|
-
host: 'localhost',
|
|
19
|
-
port: 6379,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
const worker = await Worker.create({
|
|
23
|
-
connection,
|
|
24
|
-
taskQueue: 'hello-world',
|
|
25
|
-
workflow: workflows.example,
|
|
26
|
-
activities,
|
|
27
|
-
});
|
|
28
|
-
await worker.run();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
run().catch((err) => {
|
|
32
|
-
console.error(err);
|
|
33
|
-
process.exit(1);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
export class NativeConnectionService {
|
|
39
|
-
static async connect(config: ConnectionConfig): Promise<Connection> {
|
|
40
|
-
return {
|
|
41
|
-
class: config.class,
|
|
42
|
-
options: { ...config.options },
|
|
43
|
-
} as Connection;
|
|
44
|
-
}
|
|
45
|
-
}
|