@durable-effect/jobs 0.0.1-next.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 +21 -0
- package/README.md +490 -0
- package/dist/client/client.d.ts +34 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +427 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/response.d.ts +99 -0
- package/dist/client/response.d.ts.map +1 -0
- package/dist/client/response.js +92 -0
- package/dist/client/response.js.map +1 -0
- package/dist/client/types.d.ts +242 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +3 -0
- package/dist/client/types.js.map +1 -0
- package/dist/definitions/continuous.d.ts +110 -0
- package/dist/definitions/continuous.d.ts.map +1 -0
- package/dist/definitions/continuous.js +79 -0
- package/dist/definitions/continuous.js.map +1 -0
- package/dist/definitions/debounce.d.ts +67 -0
- package/dist/definitions/debounce.d.ts.map +1 -0
- package/dist/definitions/debounce.js +28 -0
- package/dist/definitions/debounce.js.map +1 -0
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/definitions/index.js +5 -0
- package/dist/definitions/index.js.map +1 -0
- package/dist/definitions/task.d.ts +234 -0
- package/dist/definitions/task.d.ts.map +1 -0
- package/dist/definitions/task.js +106 -0
- package/dist/definitions/task.js.map +1 -0
- package/dist/engine/engine.d.ts +60 -0
- package/dist/engine/engine.d.ts.map +1 -0
- package/dist/engine/engine.js +89 -0
- package/dist/engine/engine.js.map +1 -0
- package/dist/engine/index.d.ts +3 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +3 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/types.d.ts +53 -0
- package/dist/engine/types.d.ts.map +1 -0
- package/dist/engine/types.js +3 -0
- package/dist/engine/types.js.map +1 -0
- package/dist/errors.d.ts +119 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +80 -0
- package/dist/errors.js.map +1 -0
- package/dist/factory.d.ts +97 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +94 -0
- package/dist/factory.js.map +1 -0
- package/dist/handlers/continuous/context.d.ts +25 -0
- package/dist/handlers/continuous/context.d.ts.map +1 -0
- package/dist/handlers/continuous/context.js +38 -0
- package/dist/handlers/continuous/context.js.map +1 -0
- package/dist/handlers/continuous/executor.d.ts +10 -0
- package/dist/handlers/continuous/executor.d.ts.map +1 -0
- package/dist/handlers/continuous/executor.js +83 -0
- package/dist/handlers/continuous/executor.js.map +1 -0
- package/dist/handlers/continuous/handler.d.ts +14 -0
- package/dist/handlers/continuous/handler.d.ts.map +1 -0
- package/dist/handlers/continuous/handler.js +283 -0
- package/dist/handlers/continuous/handler.js.map +1 -0
- package/dist/handlers/continuous/index.d.ts +4 -0
- package/dist/handlers/continuous/index.d.ts.map +1 -0
- package/dist/handlers/continuous/index.js +4 -0
- package/dist/handlers/continuous/index.js.map +1 -0
- package/dist/handlers/continuous/types.d.ts +36 -0
- package/dist/handlers/continuous/types.d.ts.map +1 -0
- package/dist/handlers/continuous/types.js +3 -0
- package/dist/handlers/continuous/types.js.map +1 -0
- package/dist/handlers/debounce/handler.d.ts +14 -0
- package/dist/handlers/debounce/handler.d.ts.map +1 -0
- package/dist/handlers/debounce/handler.js +261 -0
- package/dist/handlers/debounce/handler.js.map +1 -0
- package/dist/handlers/debounce/index.d.ts +3 -0
- package/dist/handlers/debounce/index.d.ts.map +1 -0
- package/dist/handlers/debounce/index.js +3 -0
- package/dist/handlers/debounce/index.js.map +1 -0
- package/dist/handlers/debounce/types.d.ts +10 -0
- package/dist/handlers/debounce/types.d.ts.map +1 -0
- package/dist/handlers/debounce/types.js +3 -0
- package/dist/handlers/debounce/types.js.map +1 -0
- package/dist/handlers/index.d.ts +14 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +25 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/task/context.d.ts +35 -0
- package/dist/handlers/task/context.d.ts.map +1 -0
- package/dist/handlers/task/context.js +156 -0
- package/dist/handlers/task/context.js.map +1 -0
- package/dist/handlers/task/handler.d.ts +13 -0
- package/dist/handlers/task/handler.d.ts.map +1 -0
- package/dist/handlers/task/handler.js +280 -0
- package/dist/handlers/task/handler.js.map +1 -0
- package/dist/handlers/task/index.d.ts +3 -0
- package/dist/handlers/task/index.d.ts.map +1 -0
- package/dist/handlers/task/index.js +2 -0
- package/dist/handlers/task/index.js.map +1 -0
- package/dist/handlers/task/types.d.ts +10 -0
- package/dist/handlers/task/types.d.ts.map +1 -0
- package/dist/handlers/task/types.js +3 -0
- package/dist/handlers/task/types.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/index.d.ts +5 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +4 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/registry.d.ts +74 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +159 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry/typed.d.ts +146 -0
- package/dist/registry/typed.d.ts.map +1 -0
- package/dist/registry/typed.js +29 -0
- package/dist/registry/typed.js.map +1 -0
- package/dist/registry/types.d.ts +497 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +3 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/retry/errors.d.ts +31 -0
- package/dist/retry/errors.d.ts.map +1 -0
- package/dist/retry/errors.js +22 -0
- package/dist/retry/errors.js.map +1 -0
- package/dist/retry/executor.d.ts +53 -0
- package/dist/retry/executor.d.ts.map +1 -0
- package/dist/retry/executor.js +112 -0
- package/dist/retry/executor.js.map +1 -0
- package/dist/retry/index.d.ts +4 -0
- package/dist/retry/index.d.ts.map +1 -0
- package/dist/retry/index.js +4 -0
- package/dist/retry/index.js.map +1 -0
- package/dist/retry/types.d.ts +29 -0
- package/dist/retry/types.d.ts.map +1 -0
- package/dist/retry/types.js +3 -0
- package/dist/retry/types.js.map +1 -0
- package/dist/runtime/dispatcher.d.ts +39 -0
- package/dist/runtime/dispatcher.d.ts.map +1 -0
- package/dist/runtime/dispatcher.js +76 -0
- package/dist/runtime/dispatcher.js.map +1 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/runtime.d.ts +88 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/runtime.js +116 -0
- package/dist/runtime/runtime.js.map +1 -0
- package/dist/runtime/types.d.ts +182 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +3 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/services/alarm.d.ts +37 -0
- package/dist/services/alarm.d.ts.map +1 -0
- package/dist/services/alarm.js +39 -0
- package/dist/services/alarm.js.map +1 -0
- package/dist/services/cleanup.d.ts +27 -0
- package/dist/services/cleanup.d.ts.map +1 -0
- package/dist/services/cleanup.js +25 -0
- package/dist/services/cleanup.js.map +1 -0
- package/dist/services/entity-state.d.ts +49 -0
- package/dist/services/entity-state.d.ts.map +1 -0
- package/dist/services/entity-state.js +72 -0
- package/dist/services/entity-state.js.map +1 -0
- package/dist/services/execution.d.ts +70 -0
- package/dist/services/execution.d.ts.map +1 -0
- package/dist/services/execution.js +159 -0
- package/dist/services/execution.js.map +1 -0
- package/dist/services/execution_test.d.ts +13 -0
- package/dist/services/execution_test.d.ts.map +1 -0
- package/dist/services/execution_test.js +11 -0
- package/dist/services/execution_test.js.map +1 -0
- package/dist/services/idempotency.d.ts +36 -0
- package/dist/services/idempotency.d.ts.map +1 -0
- package/dist/services/idempotency.js +48 -0
- package/dist/services/idempotency.js.map +1 -0
- package/dist/services/index.d.ts +19 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +33 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/metadata.d.ts +64 -0
- package/dist/services/metadata.d.ts.map +1 -0
- package/dist/services/metadata.js +56 -0
- package/dist/services/metadata.js.map +1 -0
- package/dist/services/registry.d.ts +19 -0
- package/dist/services/registry.d.ts.map +1 -0
- package/dist/services/registry.js +17 -0
- package/dist/services/registry.js.map +1 -0
- package/dist/storage-keys.d.ts +38 -0
- package/dist/storage-keys.d.ts.map +1 -0
- package/dist/storage-keys.js +47 -0
- package/dist/storage-keys.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { JobStatus } from "../services/metadata";
|
|
2
|
+
/**
|
|
3
|
+
* Union of all job request types.
|
|
4
|
+
*/
|
|
5
|
+
export type JobRequest = ContinuousRequest | DebounceRequest | WorkerPoolRequest | TaskRequest;
|
|
6
|
+
/**
|
|
7
|
+
* Continuous job request.
|
|
8
|
+
*/
|
|
9
|
+
export interface ContinuousRequest {
|
|
10
|
+
readonly type: "continuous";
|
|
11
|
+
readonly action: "start" | "terminate" | "trigger" | "status" | "getState";
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly input?: unknown;
|
|
15
|
+
readonly reason?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Debounce job request.
|
|
19
|
+
*/
|
|
20
|
+
export interface DebounceRequest {
|
|
21
|
+
readonly type: "debounce";
|
|
22
|
+
readonly action: "add" | "flush" | "clear" | "status" | "getState";
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly event?: unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* WorkerPool job request.
|
|
29
|
+
*/
|
|
30
|
+
export interface WorkerPoolRequest {
|
|
31
|
+
readonly type: "workerPool";
|
|
32
|
+
readonly action: "enqueue" | "pause" | "resume" | "cancel" | "status" | "drain";
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly instanceIndex: number;
|
|
35
|
+
readonly eventId?: string;
|
|
36
|
+
readonly event?: unknown;
|
|
37
|
+
readonly partitionKey?: string;
|
|
38
|
+
readonly priority?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Task job request.
|
|
42
|
+
*/
|
|
43
|
+
export interface TaskRequest {
|
|
44
|
+
readonly type: "task";
|
|
45
|
+
readonly action: "send" | "trigger" | "terminate" | "status" | "getState";
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly event?: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Union of all job response types.
|
|
52
|
+
*/
|
|
53
|
+
export type JobResponse = ContinuousStartResponse | ContinuousTerminateResponse | ContinuousTriggerResponse | ContinuousStatusResponse | ContinuousGetStateResponse | DebounceAddResponse | DebounceFlushResponse | DebounceClearResponse | DebounceStatusResponse | DebounceGetStateResponse | WorkerPoolEnqueueResponse | WorkerPoolPauseResponse | WorkerPoolResumeResponse | WorkerPoolCancelResponse | WorkerPoolStatusResponse | WorkerPoolDrainResponse | TaskSendResponse | TaskTriggerResponse | TaskTerminateResponse | TaskStatusResponse | TaskGetStateResponse;
|
|
54
|
+
export interface ContinuousStartResponse {
|
|
55
|
+
readonly _type: "continuous.start";
|
|
56
|
+
readonly instanceId: string;
|
|
57
|
+
readonly created: boolean;
|
|
58
|
+
readonly status: JobStatus;
|
|
59
|
+
}
|
|
60
|
+
export interface ContinuousTerminateResponse {
|
|
61
|
+
readonly _type: "continuous.terminate";
|
|
62
|
+
readonly terminated: boolean;
|
|
63
|
+
readonly reason?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ContinuousTriggerResponse {
|
|
66
|
+
readonly _type: "continuous.trigger";
|
|
67
|
+
readonly triggered: boolean;
|
|
68
|
+
/** True if the job terminated during this trigger */
|
|
69
|
+
readonly terminated?: boolean;
|
|
70
|
+
/** True if a retry was scheduled due to execution failure */
|
|
71
|
+
readonly retryScheduled?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface ContinuousStatusResponse {
|
|
74
|
+
readonly _type: "continuous.status";
|
|
75
|
+
readonly status: JobStatus | "not_found";
|
|
76
|
+
readonly nextRunAt?: number;
|
|
77
|
+
readonly runCount?: number;
|
|
78
|
+
/** Reason for stopping/terminating (if applicable) */
|
|
79
|
+
readonly stopReason?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ContinuousGetStateResponse {
|
|
82
|
+
readonly _type: "continuous.getState";
|
|
83
|
+
readonly state: unknown | null;
|
|
84
|
+
}
|
|
85
|
+
export interface DebounceAddResponse {
|
|
86
|
+
readonly _type: "debounce.add";
|
|
87
|
+
readonly instanceId: string;
|
|
88
|
+
readonly eventCount: number;
|
|
89
|
+
readonly willFlushAt: number | null;
|
|
90
|
+
readonly created: boolean;
|
|
91
|
+
/** True if a retry was scheduled due to flush execution failure */
|
|
92
|
+
readonly retryScheduled?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface DebounceFlushResponse {
|
|
95
|
+
readonly _type: "debounce.flush";
|
|
96
|
+
readonly flushed: boolean;
|
|
97
|
+
readonly eventCount: number;
|
|
98
|
+
readonly reason: "manual" | "empty" | "maxEvents" | "flushAfter";
|
|
99
|
+
/** True if a retry was scheduled due to execution failure */
|
|
100
|
+
readonly retryScheduled?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface DebounceClearResponse {
|
|
103
|
+
readonly _type: "debounce.clear";
|
|
104
|
+
readonly cleared: boolean;
|
|
105
|
+
readonly discardedEvents: number;
|
|
106
|
+
}
|
|
107
|
+
export interface DebounceStatusResponse {
|
|
108
|
+
readonly _type: "debounce.status";
|
|
109
|
+
readonly status: "debouncing" | "idle" | "not_found";
|
|
110
|
+
readonly eventCount?: number;
|
|
111
|
+
readonly startedAt?: number;
|
|
112
|
+
readonly willFlushAt?: number;
|
|
113
|
+
}
|
|
114
|
+
export interface DebounceGetStateResponse {
|
|
115
|
+
readonly _type: "debounce.getState";
|
|
116
|
+
readonly state: unknown | null;
|
|
117
|
+
}
|
|
118
|
+
export interface WorkerPoolEnqueueResponse {
|
|
119
|
+
readonly _type: "workerPool.enqueue";
|
|
120
|
+
readonly eventId: string;
|
|
121
|
+
readonly instanceId: string;
|
|
122
|
+
readonly instanceIndex: number;
|
|
123
|
+
readonly position: number;
|
|
124
|
+
readonly created: boolean;
|
|
125
|
+
readonly duplicate: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface WorkerPoolPauseResponse {
|
|
128
|
+
readonly _type: "workerPool.pause";
|
|
129
|
+
readonly paused: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface WorkerPoolResumeResponse {
|
|
132
|
+
readonly _type: "workerPool.resume";
|
|
133
|
+
readonly resumed: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface WorkerPoolCancelResponse {
|
|
136
|
+
readonly _type: "workerPool.cancel";
|
|
137
|
+
readonly cancelled: boolean;
|
|
138
|
+
readonly reason: "cancelled" | "not_found" | "already_processing" | "already_completed";
|
|
139
|
+
}
|
|
140
|
+
export interface WorkerPoolStatusResponse {
|
|
141
|
+
readonly _type: "workerPool.status";
|
|
142
|
+
readonly status: "processing" | "idle" | "paused" | "not_found";
|
|
143
|
+
readonly pendingCount?: number;
|
|
144
|
+
readonly processedCount?: number;
|
|
145
|
+
readonly currentEventId?: string | null;
|
|
146
|
+
}
|
|
147
|
+
export interface WorkerPoolDrainResponse {
|
|
148
|
+
readonly _type: "workerPool.drain";
|
|
149
|
+
readonly drained: boolean;
|
|
150
|
+
}
|
|
151
|
+
export interface TaskSendResponse {
|
|
152
|
+
readonly _type: "task.send";
|
|
153
|
+
readonly instanceId: string;
|
|
154
|
+
readonly created: boolean;
|
|
155
|
+
readonly scheduledAt: number | null;
|
|
156
|
+
}
|
|
157
|
+
export interface TaskTriggerResponse {
|
|
158
|
+
readonly _type: "task.trigger";
|
|
159
|
+
readonly instanceId: string;
|
|
160
|
+
readonly triggered: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface TaskTerminateResponse {
|
|
163
|
+
readonly _type: "task.terminate";
|
|
164
|
+
readonly instanceId: string;
|
|
165
|
+
readonly terminated: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface TaskStatusResponse {
|
|
168
|
+
readonly _type: "task.status";
|
|
169
|
+
readonly status: "active" | "idle" | "not_found";
|
|
170
|
+
readonly scheduledAt: number | null;
|
|
171
|
+
readonly createdAt: number | undefined;
|
|
172
|
+
readonly eventCount: number | undefined;
|
|
173
|
+
readonly executeCount: number | undefined;
|
|
174
|
+
}
|
|
175
|
+
export interface TaskGetStateResponse {
|
|
176
|
+
readonly _type: "task.getState";
|
|
177
|
+
readonly instanceId: string;
|
|
178
|
+
readonly state: unknown | null | undefined;
|
|
179
|
+
readonly scheduledAt: number | null;
|
|
180
|
+
readonly createdAt: number | undefined;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMtD;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,Q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,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,qCAAqC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Duration } from "effect";
|
|
2
|
+
import { SchedulerAdapter, RuntimeAdapter, type SchedulerError } from "@durable-effect/core";
|
|
3
|
+
/**
|
|
4
|
+
* AlarmService provides higher-level alarm scheduling.
|
|
5
|
+
*
|
|
6
|
+
* Unlike the raw SchedulerAdapter which only accepts timestamps,
|
|
7
|
+
* AlarmService supports:
|
|
8
|
+
* - Duration inputs ("30 minutes", Duration.minutes(30))
|
|
9
|
+
* - Date objects
|
|
10
|
+
* - Absolute timestamps (numbers)
|
|
11
|
+
*/
|
|
12
|
+
export interface AlarmServiceI {
|
|
13
|
+
/**
|
|
14
|
+
* Schedule an alarm.
|
|
15
|
+
*
|
|
16
|
+
* @param when - When to fire the alarm:
|
|
17
|
+
* - Duration: relative to now
|
|
18
|
+
* - Date: absolute time
|
|
19
|
+
* - number: absolute timestamp in ms
|
|
20
|
+
*/
|
|
21
|
+
readonly schedule: (when: Duration.DurationInput | number | Date) => Effect.Effect<void, SchedulerError>;
|
|
22
|
+
/**
|
|
23
|
+
* Cancel the scheduled alarm.
|
|
24
|
+
*/
|
|
25
|
+
readonly cancel: () => Effect.Effect<void, SchedulerError>;
|
|
26
|
+
/**
|
|
27
|
+
* Get the scheduled alarm time.
|
|
28
|
+
* Returns undefined if no alarm is scheduled.
|
|
29
|
+
*/
|
|
30
|
+
readonly getScheduled: () => Effect.Effect<number | undefined, SchedulerError>;
|
|
31
|
+
}
|
|
32
|
+
declare const AlarmService_base: Context.TagClass<AlarmService, "@durable-effect/jobs/AlarmService", AlarmServiceI>;
|
|
33
|
+
export declare class AlarmService extends AlarmService_base {
|
|
34
|
+
}
|
|
35
|
+
export declare const AlarmServiceLayer: Layer.Layer<AlarmService, never, RuntimeAdapter | SchedulerAdapter>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=alarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alarm.d.ts","sourceRoot":"","sources":["../../src/services/alarm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAM9B;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,CACjB,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,MAAM,GAAG,IAAI,KACzC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAE3D;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,cAAc,CAAC,CAAC;CAChF;;AAMD,qBAAa,YAAa,SAAQ,iBAEF;CAAG;AAMnC,eAAO,MAAM,iBAAiB,qEAiC7B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// packages/jobs/src/services/alarm.ts
|
|
2
|
+
import { Context, Effect, Layer, Duration } from "effect";
|
|
3
|
+
import { SchedulerAdapter, RuntimeAdapter, } from "@durable-effect/core";
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Service Tag
|
|
6
|
+
// =============================================================================
|
|
7
|
+
export class AlarmService extends Context.Tag("@durable-effect/jobs/AlarmService")() {
|
|
8
|
+
}
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Implementation
|
|
11
|
+
// =============================================================================
|
|
12
|
+
export const AlarmServiceLayer = Layer.effect(AlarmService, Effect.gen(function* () {
|
|
13
|
+
const scheduler = yield* SchedulerAdapter;
|
|
14
|
+
const runtime = yield* RuntimeAdapter;
|
|
15
|
+
return {
|
|
16
|
+
schedule: (when) => Effect.gen(function* () {
|
|
17
|
+
let timestamp;
|
|
18
|
+
if (typeof when === "number") {
|
|
19
|
+
// Absolute timestamp
|
|
20
|
+
timestamp = when;
|
|
21
|
+
}
|
|
22
|
+
else if (when instanceof Date) {
|
|
23
|
+
// Date object
|
|
24
|
+
timestamp = when.getTime();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// Duration - convert to absolute timestamp
|
|
28
|
+
const now = yield* runtime.now();
|
|
29
|
+
const duration = Duration.decode(when);
|
|
30
|
+
const ms = Duration.toMillis(duration);
|
|
31
|
+
timestamp = now + ms;
|
|
32
|
+
}
|
|
33
|
+
yield* scheduler.schedule(timestamp);
|
|
34
|
+
}),
|
|
35
|
+
cancel: () => scheduler.cancel(),
|
|
36
|
+
getScheduled: () => scheduler.getScheduled(),
|
|
37
|
+
};
|
|
38
|
+
}));
|
|
39
|
+
//# sourceMappingURL=alarm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alarm.js","sourceRoot":"","sources":["../../src/services/alarm.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAwC9B,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,GAAG,CAC3C,mCAAmC,CACpC,EAA+B;CAAG;AAEnC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|
2
|
+
import { StorageAdapter, type StorageError, type SchedulerError } from "@durable-effect/core";
|
|
3
|
+
import { AlarmService } from "./alarm";
|
|
4
|
+
/**
|
|
5
|
+
* CleanupService provides centralized cleanup operations for job instances.
|
|
6
|
+
*
|
|
7
|
+
* This service handles all cleanup atomically to prevent partial cleanup states
|
|
8
|
+
* where alarm continues but storage is deleted (or vice versa).
|
|
9
|
+
*/
|
|
10
|
+
export interface CleanupServiceI {
|
|
11
|
+
/**
|
|
12
|
+
* Terminate the job instance completely.
|
|
13
|
+
*
|
|
14
|
+
* This is the standard cleanup operation that:
|
|
15
|
+
* 1. Cancels any scheduled alarm
|
|
16
|
+
* 2. Deletes all storage (state, metadata, counters, etc.)
|
|
17
|
+
*
|
|
18
|
+
* After termination, the instance ID can be reused for a fresh start.
|
|
19
|
+
*/
|
|
20
|
+
readonly terminate: () => Effect.Effect<void, StorageError | SchedulerError>;
|
|
21
|
+
}
|
|
22
|
+
declare const CleanupService_base: Context.TagClass<CleanupService, "@durable-effect/jobs/CleanupService", CleanupServiceI>;
|
|
23
|
+
export declare class CleanupService extends CleanupService_base {
|
|
24
|
+
}
|
|
25
|
+
export declare const CleanupServiceLayer: Layer.Layer<CleanupService, never, StorageAdapter | AlarmService>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/services/cleanup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAAC,CAAC;CAC9E;;AAMD,qBAAa,cAAe,SAAQ,mBAEA;CAAG;AAMvC,eAAO,MAAM,mBAAmB,mEAgB/B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// packages/jobs/src/services/cleanup.ts
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
|
+
import { StorageAdapter, } from "@durable-effect/core";
|
|
4
|
+
import { AlarmService } from "./alarm";
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Service Tag
|
|
7
|
+
// =============================================================================
|
|
8
|
+
export class CleanupService extends Context.Tag("@durable-effect/jobs/CleanupService")() {
|
|
9
|
+
}
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Implementation
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const CleanupServiceLayer = Layer.effect(CleanupService, Effect.gen(function* () {
|
|
14
|
+
const storage = yield* StorageAdapter;
|
|
15
|
+
const alarm = yield* AlarmService;
|
|
16
|
+
return {
|
|
17
|
+
terminate: () => Effect.gen(function* () {
|
|
18
|
+
// Cancel alarm first to prevent it firing during cleanup
|
|
19
|
+
yield* alarm.cancel();
|
|
20
|
+
// Delete all storage (state, metadata, counters, retry state, etc.)
|
|
21
|
+
yield* storage.deleteAll();
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
}));
|
|
25
|
+
//# sourceMappingURL=cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/services/cleanup.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EACL,cAAc,GAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyBvC,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF,MAAM,OAAO,cAAe,SAAQ,OAAO,CAAC,GAAG,CAC7C,qCAAqC,CACtC,EAAmC;CAAG;AAEvC,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,CAC7C,cAAc,EACd,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,cAAc,CAAC;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,YAAY,CAAC;IAElC,OAAO;QACL,SAAS,EAAE,GAAG,EAAE,CACd,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAClB,yDAAyD;YACzD,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,oEAAoE;YACpE,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QAC7B,CAAC,CAAC;KACL,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { StorageAdapter, type StorageError } from "@durable-effect/core";
|
|
3
|
+
import { ValidationError } from "../errors";
|
|
4
|
+
/**
|
|
5
|
+
* EntityStateService provides schema-validated state management.
|
|
6
|
+
*
|
|
7
|
+
* Unlike a generic key-value store, EntityStateService:
|
|
8
|
+
* - Validates state against an Effect Schema
|
|
9
|
+
* - Returns null (not undefined) when state doesn't exist
|
|
10
|
+
* - Provides update() for atomic read-modify-write
|
|
11
|
+
*/
|
|
12
|
+
export interface EntityStateServiceI<S> {
|
|
13
|
+
/**
|
|
14
|
+
* Get the current state.
|
|
15
|
+
* Returns null if no state has been set.
|
|
16
|
+
*/
|
|
17
|
+
readonly get: () => Effect.Effect<S | null, StorageError | ValidationError>;
|
|
18
|
+
/**
|
|
19
|
+
* Set the state (validates against schema).
|
|
20
|
+
*/
|
|
21
|
+
readonly set: (state: S) => Effect.Effect<void, StorageError | ValidationError>;
|
|
22
|
+
/**
|
|
23
|
+
* Update state atomically (read-modify-write).
|
|
24
|
+
* No-op if state doesn't exist.
|
|
25
|
+
*/
|
|
26
|
+
readonly update: (fn: (current: S) => S) => Effect.Effect<void, StorageError | ValidationError>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete the state.
|
|
29
|
+
* Returns true if key existed, false otherwise.
|
|
30
|
+
*/
|
|
31
|
+
readonly delete: () => Effect.Effect<boolean, StorageError>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates an EntityStateService for a specific schema.
|
|
35
|
+
*
|
|
36
|
+
* This is a factory function (not a Layer) because each job
|
|
37
|
+
* handler needs a state service typed to its own schema.
|
|
38
|
+
*
|
|
39
|
+
* Note: Schema must have no context requirements (R = never).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const state = yield* createEntityStateService(def.stateSchema);
|
|
44
|
+
* const current = yield* state.get();
|
|
45
|
+
* yield* state.set({ ...current, count: current.count + 1 });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function createEntityStateService<A, I>(schema: Schema.Schema<A, I, never>): Effect.Effect<EntityStateServiceI<A>, never, StorageAdapter>;
|
|
49
|
+
//# sourceMappingURL=entity-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-state.d.ts","sourceRoot":"","sources":["../../src/services/entity-state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,YAAY,GAAG,eAAe,CAAC,CAAC;IAE5E;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAAC,CAAC;IAEhF;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CACf,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAClB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAAC,CAAC;IAEzD;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;CAC7D;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GACjC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CA8E9D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// packages/jobs/src/services/entity-state.ts
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
import { StorageAdapter } from "@durable-effect/core";
|
|
4
|
+
import { KEYS } from "../storage-keys";
|
|
5
|
+
import { ValidationError } from "../errors";
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// Factory Function
|
|
8
|
+
// =============================================================================
|
|
9
|
+
/**
|
|
10
|
+
* Creates an EntityStateService for a specific schema.
|
|
11
|
+
*
|
|
12
|
+
* This is a factory function (not a Layer) because each job
|
|
13
|
+
* handler needs a state service typed to its own schema.
|
|
14
|
+
*
|
|
15
|
+
* Note: Schema must have no context requirements (R = never).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const state = yield* createEntityStateService(def.stateSchema);
|
|
20
|
+
* const current = yield* state.get();
|
|
21
|
+
* yield* state.set({ ...current, count: current.count + 1 });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function createEntityStateService(schema) {
|
|
25
|
+
return Effect.gen(function* () {
|
|
26
|
+
const storage = yield* StorageAdapter;
|
|
27
|
+
// Create decode/encode functions from schema
|
|
28
|
+
const decode = Schema.decodeUnknown(schema);
|
|
29
|
+
const encode = Schema.encode(schema);
|
|
30
|
+
return {
|
|
31
|
+
get: () => Effect.gen(function* () {
|
|
32
|
+
const raw = yield* storage.get(KEYS.STATE);
|
|
33
|
+
if (raw === undefined)
|
|
34
|
+
return null;
|
|
35
|
+
// Decode with schema validation
|
|
36
|
+
const result = yield* decode(raw).pipe(Effect.mapError((error) => new ValidationError({
|
|
37
|
+
schemaName: schema.ast._tag,
|
|
38
|
+
issues: error,
|
|
39
|
+
})));
|
|
40
|
+
return result;
|
|
41
|
+
}),
|
|
42
|
+
set: (state) => Effect.gen(function* () {
|
|
43
|
+
// Encode state (converts to serializable form)
|
|
44
|
+
const encoded = yield* encode(state).pipe(Effect.mapError((error) => new ValidationError({
|
|
45
|
+
schemaName: schema.ast._tag,
|
|
46
|
+
issues: error,
|
|
47
|
+
})));
|
|
48
|
+
yield* storage.put(KEYS.STATE, encoded);
|
|
49
|
+
}),
|
|
50
|
+
update: (fn) => Effect.gen(function* () {
|
|
51
|
+
const raw = yield* storage.get(KEYS.STATE);
|
|
52
|
+
if (raw === undefined)
|
|
53
|
+
return;
|
|
54
|
+
// Decode current state
|
|
55
|
+
const current = yield* decode(raw).pipe(Effect.mapError((error) => new ValidationError({
|
|
56
|
+
schemaName: schema.ast._tag,
|
|
57
|
+
issues: error,
|
|
58
|
+
})));
|
|
59
|
+
// Apply update function
|
|
60
|
+
const updated = fn(current);
|
|
61
|
+
// Encode and save
|
|
62
|
+
const encoded = yield* encode(updated).pipe(Effect.mapError((error) => new ValidationError({
|
|
63
|
+
schemaName: schema.ast._tag,
|
|
64
|
+
issues: error,
|
|
65
|
+
})));
|
|
66
|
+
yield* storage.put(KEYS.STATE, encoded);
|
|
67
|
+
}),
|
|
68
|
+
delete: () => storage.delete(KEYS.STATE),
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=entity-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-state.js","sourceRoot":"","sources":["../../src/services/entity-state.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAyC5C,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAkC;IAElC,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,cAAc,CAAC;QAEtC,6CAA6C;QAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAErC,OAAO;YACL,GAAG,EAAE,GAAG,EAAE,CACR,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAClB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAI,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9C,IAAI,GAAG,KAAK,SAAS;oBAAE,OAAO,IAAI,CAAC;gBAEnC,gCAAgC;gBAChC,MA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AM,EAAE,KAAK;iBACd,CAAC,CACL,CACF,CAAC;gBAEF,wBAAwB;gBACxB,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;gBAE5B,kBAAkB;gBAClB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CACzC,MAAM,CAAC,QAAQ,CACb,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,eAAe,CAAC;oBAClB,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI;oBAC3B,MAAM,EAAE,KAAK;iBACd,CAAC,CACL,CACF,CAAC;gBACF,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC,CAAC;YAEJ,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;SACzC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Context, Effect, Layer, type Schema } from "effect";
|
|
2
|
+
import { RuntimeAdapter, StorageAdapter } from "@durable-effect/core";
|
|
3
|
+
import { RetryExecutor, type JobRetryConfig } from "../retry";
|
|
4
|
+
import { CleanupService } from "./cleanup";
|
|
5
|
+
import { ExecutionError } from "../errors";
|
|
6
|
+
export interface ExecutionContextBase<S> {
|
|
7
|
+
readonly getState: () => S | null;
|
|
8
|
+
readonly instanceId: string;
|
|
9
|
+
readonly runCount: number;
|
|
10
|
+
readonly attempt: number;
|
|
11
|
+
readonly isRetry: boolean;
|
|
12
|
+
readonly setState: (s: S) => void;
|
|
13
|
+
readonly updateState: (fn: (s: S) => S) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Context provided to onRetryExhausted handler.
|
|
17
|
+
*/
|
|
18
|
+
export interface OnRetryExhaustedContext<S> {
|
|
19
|
+
/** Current state (may be null) */
|
|
20
|
+
readonly state: S | null;
|
|
21
|
+
readonly instanceId: string;
|
|
22
|
+
readonly jobName: string;
|
|
23
|
+
/** Number of attempts made before exhaustion */
|
|
24
|
+
readonly attempts: number;
|
|
25
|
+
/** Total time spent retrying (ms) */
|
|
26
|
+
readonly totalDurationMs: number;
|
|
27
|
+
/** Terminate the job - cancel alarm, delete all storage */
|
|
28
|
+
readonly terminate: () => Effect.Effect<void, never, never>;
|
|
29
|
+
/** Reschedule execution - reset retry count, try again later */
|
|
30
|
+
readonly reschedule: (delay: import("effect").Duration.DurationInput) => Effect.Effect<void, never, never>;
|
|
31
|
+
/** Internal: track if terminate was called */
|
|
32
|
+
readonly _terminated: boolean;
|
|
33
|
+
/** Internal: track if reschedule was called */
|
|
34
|
+
readonly _rescheduled: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ExecuteOptions<S, E, R, Ctx> {
|
|
37
|
+
readonly jobType: "continuous" | "debounce" | "task" | "workerPool";
|
|
38
|
+
readonly jobName: string;
|
|
39
|
+
readonly schema: Schema.Schema<S, any, never>;
|
|
40
|
+
readonly retryConfig?: JobRetryConfig;
|
|
41
|
+
readonly runCount?: number;
|
|
42
|
+
readonly allowNullState?: boolean;
|
|
43
|
+
readonly run: (ctx: Ctx) => Effect.Effect<void, E, R>;
|
|
44
|
+
readonly createContext: (base: ExecutionContextBase<S>) => Ctx;
|
|
45
|
+
/**
|
|
46
|
+
* Called when all retry attempts are exhausted.
|
|
47
|
+
* If not provided, the job is terminated (state purged) by default.
|
|
48
|
+
*
|
|
49
|
+
* @param error - The last error (typed)
|
|
50
|
+
* @param ctx - Context with state access and actions (terminate, reschedule)
|
|
51
|
+
*/
|
|
52
|
+
readonly onRetryExhausted?: (error: E, ctx: OnRetryExhaustedContext<S>) => Effect.Effect<void, never, R>;
|
|
53
|
+
}
|
|
54
|
+
export interface ExecutionResult {
|
|
55
|
+
readonly success: boolean;
|
|
56
|
+
readonly retryScheduled: boolean;
|
|
57
|
+
readonly terminated: boolean;
|
|
58
|
+
readonly rescheduled: boolean;
|
|
59
|
+
readonly retryExhausted: boolean;
|
|
60
|
+
readonly terminateReason?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface JobExecutionServiceI {
|
|
63
|
+
readonly execute: <S, E, R, Ctx>(options: ExecuteOptions<S, E, R, Ctx>) => Effect.Effect<ExecutionResult, ExecutionError, R>;
|
|
64
|
+
}
|
|
65
|
+
declare const JobExecutionService_base: Context.TagClass<JobExecutionService, "@durable-effect/jobs/JobExecutionService", JobExecutionServiceI>;
|
|
66
|
+
export declare class JobExecutionService extends JobExecutionService_base {
|
|
67
|
+
}
|
|
68
|
+
export declare const JobExecutionServiceLayer: Layer.Layer<JobExecutionService, never, RuntimeAdapter | StorageAdapter | RetryExecutor | CleanupService>;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/services/execution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EACL,aAAa,EAGb,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAC;AAM5D,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAA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