@aikirun/worker 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/README.md +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ import { onboardingWorkflowV1 } from "./workflows.ts";
|
|
|
22
22
|
const aikiWorker = worker({
|
|
23
23
|
name: "worker-1",
|
|
24
24
|
workflows: [onboardingWorkflowV1],
|
|
25
|
-
subscriber: { type: "
|
|
25
|
+
subscriber: { type: "redis" },
|
|
26
26
|
opts: {
|
|
27
27
|
maxConcurrentWorkflowRuns: 10,
|
|
28
28
|
},
|
|
@@ -91,7 +91,7 @@ await orderWorker.with().opt("shards", ["eu-west"]).spawn(client);
|
|
|
91
91
|
interface WorkerParams {
|
|
92
92
|
name: string; // Unique worker name
|
|
93
93
|
workflows: WorkflowVersion[]; // Workflow versions to execute
|
|
94
|
-
subscriber?: SubscriberStrategy; // Message subscriber (default:
|
|
94
|
+
subscriber?: SubscriberStrategy; // Message subscriber (default: redis)
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
@@ -116,7 +116,7 @@ Workers receive workflow versions through the `workflows` param:
|
|
|
116
116
|
const aikiWorker = worker({
|
|
117
117
|
name: "worker-1",
|
|
118
118
|
workflows: [workflowV1, workflowV2, anotherWorkflowV1],
|
|
119
|
-
subscriber: { type: "
|
|
119
|
+
subscriber: { type: "redis" },
|
|
120
120
|
});
|
|
121
121
|
```
|
|
122
122
|
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ type TypeOfValueAtPath<T extends object, Path extends PathFromObject<T>> = Path
|
|
|
30
30
|
* @param params - Worker configuration parameters
|
|
31
31
|
* @param params.name - Unique worker name for identification and monitoring
|
|
32
32
|
* @param params.workflows - Array of workflow versions this worker can execute
|
|
33
|
-
* @param params.subscriber - Message subscriber strategy (default:
|
|
33
|
+
* @param params.subscriber - Message subscriber strategy (default: redis)
|
|
34
34
|
* @returns Worker definition, call spawn(client) to begin execution
|
|
35
35
|
*
|
|
36
36
|
* @example
|
package/dist/index.js
CHANGED
|
@@ -123,7 +123,7 @@ var WorkerHandleImpl = class {
|
|
|
123
123
|
activeWorkflowRunsById = /* @__PURE__ */ new Map();
|
|
124
124
|
async _start() {
|
|
125
125
|
const subscriberStrategyBuilder = this.client[INTERNAL].subscriber.create(
|
|
126
|
-
this.params.subscriber ?? { type: "
|
|
126
|
+
this.params.subscriber ?? { type: "redis" },
|
|
127
127
|
this.registry.getAll(),
|
|
128
128
|
this.params.opts?.shards
|
|
129
129
|
);
|
|
@@ -285,7 +285,7 @@ var WorkerHandleImpl = class {
|
|
|
285
285
|
}
|
|
286
286
|
const eventsDefinition = workflowVersion[INTERNAL].eventsDefinition;
|
|
287
287
|
const handle = await workflowRunHandle(this.client, workflowRun, eventsDefinition, logger);
|
|
288
|
-
const appContext = this.client[INTERNAL].
|
|
288
|
+
const appContext = this.client[INTERNAL].createContext ? await this.client[INTERNAL].createContext(workflowRun) : null;
|
|
289
289
|
await workflowVersion[INTERNAL].handler(
|
|
290
290
|
{
|
|
291
291
|
id: workflowRun.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikirun/worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Worker SDK for Aiki - execute workflows and tasks with durable state management and automatic recovery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"build": "tsup"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@aikirun/types": "0.
|
|
22
|
-
"@aikirun/client": "0.
|
|
23
|
-
"@aikirun/workflow": "0.
|
|
21
|
+
"@aikirun/types": "0.9.0",
|
|
22
|
+
"@aikirun/client": "0.9.0",
|
|
23
|
+
"@aikirun/workflow": "0.9.0"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|