@convex-dev/workpool 0.2.18-alpha.2 → 0.2.18
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 +74 -71
- package/dist/commonjs/client/index.d.ts +102 -38
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +124 -50
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/kick.d.ts.map +1 -1
- package/dist/commonjs/component/kick.js +2 -2
- package/dist/commonjs/component/kick.js.map +1 -1
- package/dist/commonjs/component/lib.d.ts +38 -1
- package/dist/commonjs/component/lib.d.ts.map +1 -1
- package/dist/commonjs/component/lib.js +83 -52
- package/dist/commonjs/component/lib.js.map +1 -1
- package/dist/esm/client/index.d.ts +102 -38
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +124 -50
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/kick.d.ts.map +1 -1
- package/dist/esm/component/kick.js +2 -2
- package/dist/esm/component/kick.js.map +1 -1
- package/dist/esm/component/lib.d.ts +38 -1
- package/dist/esm/component/lib.d.ts.map +1 -1
- package/dist/esm/component/lib.js +83 -52
- package/dist/esm/component/lib.js.map +1 -1
- package/package.json +13 -8
- package/src/client/index.ts +221 -83
- package/src/component/_generated/api.d.ts +34 -0
- package/src/component/kick.ts +3 -1
- package/src/component/lib.ts +99 -57
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultFunctionArgs, FunctionReference, FunctionVisibility, GenericDataModel, GenericMutationCtx, RegisteredMutation } from "convex/server";
|
|
1
|
+
import { DefaultFunctionArgs, FunctionReference, FunctionType, FunctionVisibility, GenericDataModel, GenericMutationCtx, RegisteredMutation } from "convex/server";
|
|
2
2
|
import { Infer, Validator, VAny, VString } from "convex/values";
|
|
3
3
|
import { Mounts } from "../component/_generated/api.js";
|
|
4
4
|
import { type LogLevel } from "../component/logging.js";
|
|
@@ -16,7 +16,7 @@ export {
|
|
|
16
16
|
vWorkIdValidator as workIdValidator,
|
|
17
17
|
/** @deprecated Use `vResultValidator` instead. */
|
|
18
18
|
vResultValidator as resultValidator, };
|
|
19
|
-
/**
|
|
19
|
+
/** Equivalent to `vOnCompleteArgs(<your-context-validator>)`. */
|
|
20
20
|
export declare const vOnComplete: import("convex/values").VObject<{
|
|
21
21
|
context: any;
|
|
22
22
|
workId: WorkId;
|
|
@@ -31,7 +31,7 @@ export declare const vOnComplete: import("convex/values").VObject<{
|
|
|
31
31
|
};
|
|
32
32
|
}, {
|
|
33
33
|
workId: VString<WorkId, "required">;
|
|
34
|
-
context: VAny<any, "required", string
|
|
34
|
+
context: VAny<any, "required", string>;
|
|
35
35
|
result: import("convex/values").VUnion<{
|
|
36
36
|
kind: "success";
|
|
37
37
|
returnValue: any;
|
|
@@ -61,8 +61,9 @@ export declare const vOnComplete: import("convex/values").VObject<{
|
|
|
61
61
|
/** @deprecated Use `vOnCompleteArgs()` instead. */
|
|
62
62
|
export declare const vOnCompleteValidator: typeof vOnCompleteArgs;
|
|
63
63
|
export declare const DEFAULT_RETRY_BEHAVIOR: RetryBehavior;
|
|
64
|
+
export type WorkpoolComponent = UseApi<Mounts>;
|
|
64
65
|
export declare class Workpool {
|
|
65
|
-
|
|
66
|
+
component: WorkpoolComponent;
|
|
66
67
|
options: WorkpoolOptions;
|
|
67
68
|
/**
|
|
68
69
|
* Initializes a Workpool.
|
|
@@ -75,8 +76,7 @@ export declare class Workpool {
|
|
|
75
76
|
* `./_generated/api.ts`.
|
|
76
77
|
* @param options - The {@link WorkpoolOptions} for the Workpool.
|
|
77
78
|
*/
|
|
78
|
-
constructor(component:
|
|
79
|
-
options: WorkpoolOptions);
|
|
79
|
+
constructor(component: WorkpoolComponent, options: WorkpoolOptions);
|
|
80
80
|
/**
|
|
81
81
|
* Enqueues an action to be run.
|
|
82
82
|
*
|
|
@@ -87,7 +87,20 @@ export declare class Workpool {
|
|
|
87
87
|
* onComplete handling, and scheduling via `runAt` or `runAfter`.
|
|
88
88
|
* @returns The ID of the work that was enqueued.
|
|
89
89
|
*/
|
|
90
|
-
enqueueAction<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"action", FunctionVisibility, Args, ReturnType>, fnArgs: Args, options?: RetryOption &
|
|
90
|
+
enqueueAction<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"action", FunctionVisibility, Args, ReturnType>, fnArgs: Args, options?: RetryOption & EnqueueOptions): Promise<WorkId>;
|
|
91
|
+
/**
|
|
92
|
+
* Enqueues a batch of actions to be run.
|
|
93
|
+
* Each action will be run independently, and the onComplete handler will
|
|
94
|
+
* be called for each action.
|
|
95
|
+
*
|
|
96
|
+
* @param ctx - The mutation or action ctx that can call ctx.runMutation.
|
|
97
|
+
* @param fn - The action to run, like `internal.example.myAction`.
|
|
98
|
+
* @param argsArray - The arguments to pass to the action.
|
|
99
|
+
* @param options - The options for the actions to specify retry behavior,
|
|
100
|
+
* onComplete handling, and scheduling via `runAt` or `runAfter`.
|
|
101
|
+
* @returns The IDs of the work that was enqueued.
|
|
102
|
+
*/
|
|
103
|
+
enqueueActionBatch<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"action", FunctionVisibility, Args, ReturnType>, argsArray: Array<Args>, options?: RetryOption & EnqueueOptions): Promise<WorkId[]>;
|
|
91
104
|
/**
|
|
92
105
|
* Enqueues a mutation to be run.
|
|
93
106
|
*
|
|
@@ -101,8 +114,44 @@ export declare class Workpool {
|
|
|
101
114
|
* @param options - The options for the mutation to specify onComplete handling
|
|
102
115
|
* and scheduling via `runAt` or `runAfter`.
|
|
103
116
|
*/
|
|
104
|
-
enqueueMutation<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"mutation", FunctionVisibility, Args, ReturnType>, fnArgs: Args, options?:
|
|
105
|
-
|
|
117
|
+
enqueueMutation<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"mutation", FunctionVisibility, Args, ReturnType>, fnArgs: Args, options?: EnqueueOptions): Promise<WorkId>;
|
|
118
|
+
/**
|
|
119
|
+
* Enqueues a batch of mutations to be run.
|
|
120
|
+
* Each mutation will be run independently, and the onComplete handler will
|
|
121
|
+
* be called for each mutation.
|
|
122
|
+
*
|
|
123
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
124
|
+
* @param fn - The mutation to run, like `internal.example.myMutation`.
|
|
125
|
+
* @param argsArray - The arguments to pass to the mutations.
|
|
126
|
+
* @param options - The options for the mutations to specify onComplete handling
|
|
127
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
128
|
+
*/
|
|
129
|
+
enqueueMutationBatch<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"mutation", FunctionVisibility, Args, ReturnType>, argsArray: Array<Args>, options?: EnqueueOptions): Promise<WorkId[]>;
|
|
130
|
+
/**
|
|
131
|
+
* Enqueues a query to be run.
|
|
132
|
+
* Usually not what you want, but it can be useful during workflows.
|
|
133
|
+
* The query is run in a mutation and the result is returned to the caller,
|
|
134
|
+
* so it can conflict if other mutations are writing the value.
|
|
135
|
+
*
|
|
136
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
137
|
+
* @param fn - The query to run, like `internal.example.myQuery`.
|
|
138
|
+
* @param fnArgs - The arguments to pass to the query.
|
|
139
|
+
* @param options - The options for the query to specify onComplete handling
|
|
140
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
141
|
+
*/
|
|
142
|
+
enqueueQuery<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"query", FunctionVisibility, Args, ReturnType>, fnArgs: Args, options?: EnqueueOptions): Promise<WorkId>;
|
|
143
|
+
/**
|
|
144
|
+
* Enqueues a batch of queries to be run.
|
|
145
|
+
* Each query will be run independently, and the onComplete handler will
|
|
146
|
+
* be called for each query.
|
|
147
|
+
*
|
|
148
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
149
|
+
* @param fn - The query to run, like `internal.example.myQuery`.
|
|
150
|
+
* @param argsArray - The arguments to pass to the queries.
|
|
151
|
+
* @param options - The options for the queries to specify onComplete handling
|
|
152
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
153
|
+
*/
|
|
154
|
+
enqueueQueryBatch<Args extends DefaultFunctionArgs, ReturnType>(ctx: RunMutationCtx, fn: FunctionReference<"query", FunctionVisibility, Args, ReturnType>, argsArray: Array<Args>, options?: EnqueueOptions): Promise<WorkId[]>;
|
|
106
155
|
/**
|
|
107
156
|
* Cancels a work item. If it's already started, it will be allowed to finish
|
|
108
157
|
* but will not be retried.
|
|
@@ -128,6 +177,14 @@ export declare class Workpool {
|
|
|
128
177
|
* - `{ state: "finished" }`
|
|
129
178
|
*/
|
|
130
179
|
status(ctx: RunQueryCtx, id: WorkId): Promise<Status>;
|
|
180
|
+
/**
|
|
181
|
+
* Gets the status of a batch of work items.
|
|
182
|
+
*
|
|
183
|
+
* @param ctx - The query context that can call ctx.runQuery.
|
|
184
|
+
* @param ids - The IDs of the work to get the status of.
|
|
185
|
+
* @returns The status of the work items.
|
|
186
|
+
*/
|
|
187
|
+
statusBatch(ctx: RunQueryCtx, ids: WorkId[]): Promise<Status[]>;
|
|
131
188
|
/**
|
|
132
189
|
* Defines a mutation that will be run after a work item completes.
|
|
133
190
|
* You can pass this to a call to enqueue* like so:
|
|
@@ -170,9 +227,9 @@ export declare class Workpool {
|
|
|
170
227
|
* @param context - The context validator. If not provided, it will be `v.any()`.
|
|
171
228
|
* @returns The validator for the onComplete mutation.
|
|
172
229
|
*/
|
|
173
|
-
export declare function vOnCompleteArgs<V extends Validator<any, "required", any> = VAny>(context?: V): import("convex/values").VObject<import("convex/server").Expand<{ [Property in
|
|
230
|
+
export declare function vOnCompleteArgs<V extends Validator<any, "required", any> = VAny>(context?: V): import("convex/values").VObject<import("convex/server").Expand<{ [Property in V["isOptional"] extends "optional" ? "context" : never]?: Exclude<Infer<{
|
|
174
231
|
workId: VString<WorkId, "required">;
|
|
175
|
-
context:
|
|
232
|
+
context: V;
|
|
176
233
|
result: import("convex/values").VUnion<{
|
|
177
234
|
kind: "success";
|
|
178
235
|
returnValue: any;
|
|
@@ -198,9 +255,9 @@ export declare function vOnCompleteArgs<V extends Validator<any, "required", any
|
|
|
198
255
|
}, {
|
|
199
256
|
kind: import("convex/values").VLiteral<"canceled", "required">;
|
|
200
257
|
}, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
|
|
201
|
-
}[Property]>, undefined> | undefined; } & { [Property_1 in Exclude<"context",
|
|
258
|
+
}[Property]>, undefined> | undefined; } & { [Property_1 in Exclude<"context", V["isOptional"] extends "optional" ? "context" : never> | Exclude<"workId", V["isOptional"] extends "optional" ? "context" : never> | Exclude<"result", V["isOptional"] extends "optional" ? "context" : never>]: Infer<{
|
|
202
259
|
workId: VString<WorkId, "required">;
|
|
203
|
-
context:
|
|
260
|
+
context: V;
|
|
204
261
|
result: import("convex/values").VUnion<{
|
|
205
262
|
kind: "success";
|
|
206
263
|
returnValue: any;
|
|
@@ -228,7 +285,7 @@ export declare function vOnCompleteArgs<V extends Validator<any, "required", any
|
|
|
228
285
|
}, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
|
|
229
286
|
}[Property_1]>; }>, {
|
|
230
287
|
workId: VString<WorkId, "required">;
|
|
231
|
-
context:
|
|
288
|
+
context: V;
|
|
232
289
|
result: import("convex/values").VUnion<{
|
|
233
290
|
kind: "success";
|
|
234
291
|
returnValue: any;
|
|
@@ -254,15 +311,7 @@ export declare function vOnCompleteArgs<V extends Validator<any, "required", any
|
|
|
254
311
|
}, {
|
|
255
312
|
kind: import("convex/values").VLiteral<"canceled", "required">;
|
|
256
313
|
}, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
|
|
257
|
-
}, "required", "context" | "workId" | "result" | `context.${
|
|
258
|
-
export type NameOption = {
|
|
259
|
-
/**
|
|
260
|
-
* The name of the function. By default, if you pass in api.foo.bar.baz,
|
|
261
|
-
* it will use "foo/bar:baz" as the name. If you pass in a function handle,
|
|
262
|
-
* it will use the function handle directly.
|
|
263
|
-
*/
|
|
264
|
-
name?: string;
|
|
265
|
-
};
|
|
314
|
+
}, "required", "context" | "workId" | "result" | `context.${V["fieldPaths"]}` | "result.kind" | "result.returnValue" | `result.returnValue.${string}` | "result.error">;
|
|
266
315
|
export type RetryOption = {
|
|
267
316
|
/** Whether to retry the action if it fails.
|
|
268
317
|
* If true, it will use the default retry behavior.
|
|
@@ -298,22 +347,13 @@ export type WorkpoolRetryOptions = {
|
|
|
298
347
|
*/
|
|
299
348
|
retryActionsByDefault?: boolean;
|
|
300
349
|
};
|
|
301
|
-
export type
|
|
302
|
-
/**
|
|
303
|
-
* The time (ms since epoch) to run the action at.
|
|
304
|
-
* If not provided, the action will be run as soon as possible.
|
|
305
|
-
* Note: this is advisory only. It may run later.
|
|
306
|
-
*/
|
|
307
|
-
runAt?: number;
|
|
308
|
-
} | {
|
|
350
|
+
export type EnqueueOptions = {
|
|
309
351
|
/**
|
|
310
|
-
* The
|
|
311
|
-
*
|
|
312
|
-
*
|
|
352
|
+
* The name of the function. By default, if you pass in api.foo.bar.baz,
|
|
353
|
+
* it will use "foo/bar:baz" as the name. If you pass in a function handle,
|
|
354
|
+
* it will use the function handle directly.
|
|
313
355
|
*/
|
|
314
|
-
|
|
315
|
-
};
|
|
316
|
-
export type CallbackOptions = {
|
|
356
|
+
name?: string;
|
|
317
357
|
/**
|
|
318
358
|
* A mutation to run after the function succeeds, fails, or is canceled.
|
|
319
359
|
* The context type is for your use, feel free to provide a validator for it.
|
|
@@ -343,7 +383,21 @@ export type CallbackOptions = {
|
|
|
343
383
|
* Useful for passing data from the enqueue site to the onComplete site.
|
|
344
384
|
*/
|
|
345
385
|
context?: unknown;
|
|
346
|
-
}
|
|
386
|
+
} & ({
|
|
387
|
+
/**
|
|
388
|
+
* The time (ms since epoch) to run the action at.
|
|
389
|
+
* If not provided, the action will be run as soon as possible.
|
|
390
|
+
* Note: this is advisory only. It may run later.
|
|
391
|
+
*/
|
|
392
|
+
runAt?: number;
|
|
393
|
+
} | {
|
|
394
|
+
/**
|
|
395
|
+
* The number of milliseconds to run the action after.
|
|
396
|
+
* If not provided, the action will be run as soon as possible.
|
|
397
|
+
* Note: this is advisory only. It may run later.
|
|
398
|
+
*/
|
|
399
|
+
runAfter?: number;
|
|
400
|
+
});
|
|
347
401
|
export type OnCompleteArgs = {
|
|
348
402
|
/**
|
|
349
403
|
* The ID of the work that completed.
|
|
@@ -359,4 +413,14 @@ export type OnCompleteArgs = {
|
|
|
359
413
|
*/
|
|
360
414
|
result: RunResult;
|
|
361
415
|
};
|
|
416
|
+
export declare function enqueueBatch<FnType extends FunctionType, Args extends DefaultFunctionArgs, ReturnType>(component: UseApi<Mounts>, ctx: RunMutationCtx, fnType: FnType, fn: FunctionReference<FnType, FunctionVisibility, Args, ReturnType>, fnArgsArray: Array<Args>, options: EnqueueOptions & {
|
|
417
|
+
retryBehavior?: RetryBehavior;
|
|
418
|
+
maxParallelism?: number;
|
|
419
|
+
logLevel?: LogLevel;
|
|
420
|
+
}): Promise<WorkId[]>;
|
|
421
|
+
export declare function enqueue<FnType extends FunctionType, Args extends DefaultFunctionArgs, ReturnType>(component: UseApi<Mounts>, ctx: RunMutationCtx, fnType: FnType, fn: FunctionReference<FnType, FunctionVisibility, Args, ReturnType>, fnArgs: Args, options: EnqueueOptions & {
|
|
422
|
+
retryBehavior?: RetryBehavior;
|
|
423
|
+
maxParallelism?: number;
|
|
424
|
+
logLevel?: LogLevel;
|
|
425
|
+
}): Promise<WorkId>;
|
|
362
426
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OA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AAkB,EAAE,IAAI,EAAE,UAAU,CAAC,EACnE,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,cAAc,GAAG;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,GACA,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
package/dist/esm/client/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export {
|
|
|
12
12
|
vWorkIdValidator as workIdValidator,
|
|
13
13
|
/** @deprecated Use `vResultValidator` instead. */
|
|
14
14
|
vResultValidator as resultValidator, };
|
|
15
|
-
/**
|
|
15
|
+
/** Equivalent to `vOnCompleteArgs(<your-context-validator>)`. */
|
|
16
16
|
export const vOnComplete = vOnCompleteArgs(v.any());
|
|
17
17
|
/** @deprecated Use `vOnCompleteArgs()` instead. */
|
|
18
18
|
export const vOnCompleteValidator = vOnCompleteArgs;
|
|
@@ -36,8 +36,7 @@ export class Workpool {
|
|
|
36
36
|
* `./_generated/api.ts`.
|
|
37
37
|
* @param options - The {@link WorkpoolOptions} for the Workpool.
|
|
38
38
|
*/
|
|
39
|
-
constructor(component,
|
|
40
|
-
options) {
|
|
39
|
+
constructor(component, options) {
|
|
41
40
|
this.component = component;
|
|
42
41
|
this.options = options;
|
|
43
42
|
}
|
|
@@ -53,21 +52,31 @@ export class Workpool {
|
|
|
53
52
|
*/
|
|
54
53
|
async enqueueAction(ctx, fn, fnArgs, options) {
|
|
55
54
|
const retryBehavior = getRetryBehavior(this.options.defaultRetryBehavior, this.options.retryActionsByDefault, options?.retry);
|
|
56
|
-
|
|
57
|
-
? {
|
|
58
|
-
fnHandle: await createFunctionHandle(options.onComplete),
|
|
59
|
-
context: options.context,
|
|
60
|
-
}
|
|
61
|
-
: undefined;
|
|
62
|
-
const id = await ctx.runMutation(this.component.lib.enqueue, {
|
|
63
|
-
...(await defaultEnqueueArgs(fn, options?.name, this.options)),
|
|
64
|
-
fnArgs,
|
|
65
|
-
fnType: "action",
|
|
66
|
-
runAt: getRunAt(options),
|
|
67
|
-
onComplete,
|
|
55
|
+
return enqueue(this.component, ctx, "action", fn, fnArgs, {
|
|
68
56
|
retryBehavior,
|
|
57
|
+
...this.options,
|
|
58
|
+
...options,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Enqueues a batch of actions to be run.
|
|
63
|
+
* Each action will be run independently, and the onComplete handler will
|
|
64
|
+
* be called for each action.
|
|
65
|
+
*
|
|
66
|
+
* @param ctx - The mutation or action ctx that can call ctx.runMutation.
|
|
67
|
+
* @param fn - The action to run, like `internal.example.myAction`.
|
|
68
|
+
* @param argsArray - The arguments to pass to the action.
|
|
69
|
+
* @param options - The options for the actions to specify retry behavior,
|
|
70
|
+
* onComplete handling, and scheduling via `runAt` or `runAfter`.
|
|
71
|
+
* @returns The IDs of the work that was enqueued.
|
|
72
|
+
*/
|
|
73
|
+
async enqueueActionBatch(ctx, fn, argsArray, options) {
|
|
74
|
+
const retryBehavior = getRetryBehavior(this.options.defaultRetryBehavior, this.options.retryActionsByDefault, options?.retry);
|
|
75
|
+
return enqueueBatch(this.component, ctx, "action", fn, argsArray, {
|
|
76
|
+
retryBehavior,
|
|
77
|
+
...this.options,
|
|
78
|
+
...options,
|
|
69
79
|
});
|
|
70
|
-
return id;
|
|
71
80
|
}
|
|
72
81
|
/**
|
|
73
82
|
* Enqueues a mutation to be run.
|
|
@@ -83,36 +92,62 @@ export class Workpool {
|
|
|
83
92
|
* and scheduling via `runAt` or `runAfter`.
|
|
84
93
|
*/
|
|
85
94
|
async enqueueMutation(ctx, fn, fnArgs, options) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
context: options.context,
|
|
90
|
-
}
|
|
91
|
-
: undefined;
|
|
92
|
-
const id = await ctx.runMutation(this.component.lib.enqueue, {
|
|
93
|
-
...(await defaultEnqueueArgs(fn, options?.name, this.options)),
|
|
94
|
-
fnArgs,
|
|
95
|
-
fnType: "mutation",
|
|
96
|
-
runAt: getRunAt(options),
|
|
97
|
-
onComplete,
|
|
95
|
+
return enqueue(this.component, ctx, "mutation", fn, fnArgs, {
|
|
96
|
+
...this.options,
|
|
97
|
+
...options,
|
|
98
98
|
});
|
|
99
|
-
return id;
|
|
100
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Enqueues a batch of mutations to be run.
|
|
102
|
+
* Each mutation will be run independently, and the onComplete handler will
|
|
103
|
+
* be called for each mutation.
|
|
104
|
+
*
|
|
105
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
106
|
+
* @param fn - The mutation to run, like `internal.example.myMutation`.
|
|
107
|
+
* @param argsArray - The arguments to pass to the mutations.
|
|
108
|
+
* @param options - The options for the mutations to specify onComplete handling
|
|
109
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
110
|
+
*/
|
|
111
|
+
async enqueueMutationBatch(ctx, fn, argsArray, options) {
|
|
112
|
+
return enqueueBatch(this.component, ctx, "mutation", fn, argsArray, {
|
|
113
|
+
...this.options,
|
|
114
|
+
...options,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Enqueues a query to be run.
|
|
119
|
+
* Usually not what you want, but it can be useful during workflows.
|
|
120
|
+
* The query is run in a mutation and the result is returned to the caller,
|
|
121
|
+
* so it can conflict if other mutations are writing the value.
|
|
122
|
+
*
|
|
123
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
124
|
+
* @param fn - The query to run, like `internal.example.myQuery`.
|
|
125
|
+
* @param fnArgs - The arguments to pass to the query.
|
|
126
|
+
* @param options - The options for the query to specify onComplete handling
|
|
127
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
128
|
+
*/
|
|
101
129
|
async enqueueQuery(ctx, fn, fnArgs, options) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
130
|
+
return enqueue(this.component, ctx, "query", fn, fnArgs, {
|
|
131
|
+
...this.options,
|
|
132
|
+
...options,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Enqueues a batch of queries to be run.
|
|
137
|
+
* Each query will be run independently, and the onComplete handler will
|
|
138
|
+
* be called for each query.
|
|
139
|
+
*
|
|
140
|
+
* @param ctx - The mutation or action context that can call ctx.runMutation.
|
|
141
|
+
* @param fn - The query to run, like `internal.example.myQuery`.
|
|
142
|
+
* @param argsArray - The arguments to pass to the queries.
|
|
143
|
+
* @param options - The options for the queries to specify onComplete handling
|
|
144
|
+
* and scheduling via `runAt` or `runAfter`.
|
|
145
|
+
*/
|
|
146
|
+
async enqueueQueryBatch(ctx, fn, argsArray, options) {
|
|
147
|
+
return enqueueBatch(this.component, ctx, "query", fn, argsArray, {
|
|
148
|
+
...this.options,
|
|
149
|
+
...options,
|
|
114
150
|
});
|
|
115
|
-
return id;
|
|
116
151
|
}
|
|
117
152
|
/**
|
|
118
153
|
* Cancels a work item. If it's already started, it will be allowed to finish
|
|
@@ -150,6 +185,16 @@ export class Workpool {
|
|
|
150
185
|
async status(ctx, id) {
|
|
151
186
|
return ctx.runQuery(this.component.lib.status, { id });
|
|
152
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Gets the status of a batch of work items.
|
|
190
|
+
*
|
|
191
|
+
* @param ctx - The query context that can call ctx.runQuery.
|
|
192
|
+
* @param ids - The IDs of the work to get the status of.
|
|
193
|
+
* @returns The status of the work items.
|
|
194
|
+
*/
|
|
195
|
+
async statusBatch(ctx, ids) {
|
|
196
|
+
return ctx.runQuery(this.component.lib.statusBatch, { ids });
|
|
197
|
+
}
|
|
153
198
|
/**
|
|
154
199
|
* Defines a mutation that will be run after a work item completes.
|
|
155
200
|
* You can pass this to a call to enqueue* like so:
|
|
@@ -193,7 +238,7 @@ export class Workpool {
|
|
|
193
238
|
export function vOnCompleteArgs(context) {
|
|
194
239
|
return v.object({
|
|
195
240
|
workId: vWorkIdValidator,
|
|
196
|
-
context: context ?? v.optional(v.any()),
|
|
241
|
+
context: (context ?? v.optional(v.any())),
|
|
197
242
|
result: vResultValidator,
|
|
198
243
|
});
|
|
199
244
|
}
|
|
@@ -214,16 +259,25 @@ function getRetryBehavior(defaultRetryBehavior, retryActionsByDefault, retryOver
|
|
|
214
259
|
}
|
|
215
260
|
return retryOverride ?? (retryByDefault ? defaultRetry : undefined);
|
|
216
261
|
}
|
|
217
|
-
async function
|
|
262
|
+
async function enqueueArgs(fn, opts) {
|
|
218
263
|
const [fnHandle, fnName] = typeof fn === "string" && fn.startsWith("function://")
|
|
219
|
-
? [fn, name ?? fn]
|
|
220
|
-
: [await createFunctionHandle(fn), name ?? safeFunctionName(fn)];
|
|
264
|
+
? [fn, opts?.name ?? fn]
|
|
265
|
+
: [await createFunctionHandle(fn), opts?.name ?? safeFunctionName(fn)];
|
|
266
|
+
const onComplete = opts?.onComplete
|
|
267
|
+
? {
|
|
268
|
+
fnHandle: await createFunctionHandle(opts.onComplete),
|
|
269
|
+
context: opts.context,
|
|
270
|
+
}
|
|
271
|
+
: undefined;
|
|
221
272
|
return {
|
|
222
273
|
fnHandle,
|
|
223
274
|
fnName,
|
|
275
|
+
onComplete,
|
|
276
|
+
runAt: getRunAt(opts),
|
|
277
|
+
retryBehavior: opts?.retryBehavior,
|
|
224
278
|
config: {
|
|
225
|
-
logLevel: logLevel ?? DEFAULT_LOG_LEVEL,
|
|
226
|
-
maxParallelism: maxParallelism ?? DEFAULT_MAX_PARALLELISM,
|
|
279
|
+
logLevel: opts?.logLevel ?? DEFAULT_LOG_LEVEL,
|
|
280
|
+
maxParallelism: opts?.maxParallelism ?? DEFAULT_MAX_PARALLELISM,
|
|
227
281
|
},
|
|
228
282
|
};
|
|
229
283
|
}
|
|
@@ -231,12 +285,32 @@ function getRunAt(options) {
|
|
|
231
285
|
if (!options) {
|
|
232
286
|
return Date.now();
|
|
233
287
|
}
|
|
234
|
-
if (
|
|
288
|
+
if (options.runAt !== undefined) {
|
|
235
289
|
return options.runAt;
|
|
236
290
|
}
|
|
237
|
-
if (
|
|
291
|
+
if (options.runAfter !== undefined) {
|
|
238
292
|
return Date.now() + options.runAfter;
|
|
239
293
|
}
|
|
240
294
|
return Date.now();
|
|
241
295
|
}
|
|
296
|
+
export async function enqueueBatch(component, ctx, fnType, fn, fnArgsArray, options) {
|
|
297
|
+
const { config, ...defaults } = await enqueueArgs(fn, options);
|
|
298
|
+
const ids = await ctx.runMutation(component.lib.enqueueBatch, {
|
|
299
|
+
items: fnArgsArray.map((fnArgs) => ({
|
|
300
|
+
...defaults,
|
|
301
|
+
fnArgs,
|
|
302
|
+
fnType,
|
|
303
|
+
})),
|
|
304
|
+
config,
|
|
305
|
+
});
|
|
306
|
+
return ids;
|
|
307
|
+
}
|
|
308
|
+
export async function enqueue(component, ctx, fnType, fn, fnArgs, options) {
|
|
309
|
+
const id = await ctx.runMutation(component.lib.enqueue, {
|
|
310
|
+
...(await enqueueArgs(fn, options)),
|
|
311
|
+
fnArgs,
|
|
312
|
+
fnType,
|
|
313
|
+
});
|
|
314
|
+
return id;
|
|
315
|
+
}
|
|
242
316
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAQpB,uBAAuB,GAExB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAS,CAAC,EAA4B,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAEL,uBAAuB,EAEvB,gBAAgB,GAKjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,gBAAgB,GAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,E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OAAO,EAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kick.d.ts","sourceRoot":"","sources":["../../../src/component/kick.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvE,OAAO,EAEL,MAAM,
|
|
1
|
+
{"version":3,"file":"kick.d.ts","sourceRoot":"","sources":["../../../src/component/kick.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvE,OAAO,EAEL,MAAM,EAOP,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,EAClD,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GACvB,OAAO,CAAC,MAAM,CAAC,CAiDjB;AAED,eAAO,MAAM,SAAS,2EAOpB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { internal } from "./_generated/api.js";
|
|
|
2
2
|
import { internalMutation } from "./_generated/server.js";
|
|
3
3
|
import { createLogger, DEFAULT_LOG_LEVEL } from "./logging.js";
|
|
4
4
|
import { INITIAL_STATE } from "./loop.js";
|
|
5
|
-
import { boundScheduledTime, DEFAULT_MAX_PARALLELISM, fromSegment, getCurrentSegment, getNextSegment, } from "./shared.js";
|
|
5
|
+
import { boundScheduledTime, DEFAULT_MAX_PARALLELISM, fromSegment, getCurrentSegment, getNextSegment, SECOND, toSegment, } from "./shared.js";
|
|
6
6
|
/**
|
|
7
7
|
* Called from outside the loop.
|
|
8
8
|
* Returns the soonest segment to enqueue work for the main loop.
|
|
@@ -23,7 +23,7 @@ export async function kickMainLoop(ctx, source, config) {
|
|
|
23
23
|
console.debug(`[${source}] main is saturated, so we don't need to kick it`);
|
|
24
24
|
return next;
|
|
25
25
|
}
|
|
26
|
-
if (runStatus.state.segment <=
|
|
26
|
+
if (runStatus.state.segment <= toSegment(Date.now() + SECOND)) {
|
|
27
27
|
console.debug(`[${source}] main is scheduled to run soon enough, so we don't need to kick it`);
|
|
28
28
|
return next;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kick.js","sourceRoot":"","sources":["../../../src/component/kick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAe,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAElB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,cAAc,
|
|
1
|
+
{"version":3,"file":"kick.js","sourceRoot":"","sources":["../../../src/component/kick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAe,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAElB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,SAAS,GACV,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAgB,EAChB,MAAkD,EAClD,MAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAAC,GAAG,C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