Skip to content

Commit 004519d

Browse files
committed
.
1 parent 0797167 commit 004519d

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

example/convex/_generated/api.d.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ export declare const components: {
5858
fnName: string;
5959
fnType: "action" | "mutation";
6060
options: {
61-
fastHeartbeatMs?: number;
6261
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR";
6362
maxParallelism: number;
64-
mutationTimeoutMs?: number;
65-
slowHeartbeatMs?: number;
6663
ttl?: number;
6764
};
6865
},
@@ -81,7 +78,6 @@ export declare const components: {
8178
}
8279
>;
8380
stopCleanup: FunctionReference<"mutation", "internal", {}, any>;
84-
stopMainLoop: FunctionReference<"mutation", "internal", {}, any>;
8581
};
8682
};
8783
lowpriWorkpool: {
@@ -102,11 +98,8 @@ export declare const components: {
10298
fnName: string;
10399
fnType: "action" | "mutation";
104100
options: {
105-
fastHeartbeatMs?: number;
106101
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR";
107102
maxParallelism: number;
108-
mutationTimeoutMs?: number;
109-
slowHeartbeatMs?: number;
110103
ttl?: number;
111104
};
112105
},
@@ -125,7 +118,46 @@ export declare const components: {
125118
}
126119
>;
127120
stopCleanup: FunctionReference<"mutation", "internal", {}, any>;
128-
stopMainLoop: FunctionReference<"mutation", "internal", {}, any>;
121+
};
122+
};
123+
highPriWorkpool: {
124+
lib: {
125+
cancel: FunctionReference<"mutation", "internal", { id: string }, any>;
126+
cleanup: FunctionReference<
127+
"mutation",
128+
"internal",
129+
{ maxAgeMs: number },
130+
any
131+
>;
132+
enqueue: FunctionReference<
133+
"mutation",
134+
"internal",
135+
{
136+
fnArgs: any;
137+
fnHandle: string;
138+
fnName: string;
139+
fnType: "action" | "mutation";
140+
options: {
141+
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR";
142+
maxParallelism: number;
143+
ttl?: number;
144+
};
145+
},
146+
string
147+
>;
148+
startMainLoop: FunctionReference<"mutation", "internal", {}, any>;
149+
status: FunctionReference<
150+
"query",
151+
"internal",
152+
{ id: string },
153+
| { kind: "pending" }
154+
| { kind: "inProgress" }
155+
| {
156+
completionStatus: "success" | "error" | "canceled" | "timeout";
157+
kind: "completed";
158+
}
159+
>;
160+
stopCleanup: FunctionReference<"mutation", "internal", {}, any>;
129161
};
130162
};
131163
};

example/convex/convex.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import workpool from "@convex-dev/workpool/convex.config";
44
const app = defineApp();
55
app.use(workpool);
66
app.use(workpool, { name: "lowpriWorkpool" });
7+
app.use(workpool, { name: "highPriWorkpool" });
78

89
export default app;

example/convex/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { api, components, internal } from "./_generated/api";
99
import { WorkPool } from "@convex-dev/workpool";
1010
import { v } from "convex/values";
1111

12-
const highPriPool = new WorkPool(components.workpool, {
12+
const highPriPool = new WorkPool(components.highPriWorkpool, {
1313
maxParallelism: 20,
1414
// For tests, disable completed work cleanup.
1515
ttl: Number.POSITIVE_INFINITY,

0 commit comments

Comments
 (0)