bunqueue 2.8.52 → 2.8.54
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/dist/application/backgroundTasks.js +5 -1
- package/dist/application/cleanupTasks.js +1 -1
- package/dist/application/clientTracking.js +1 -1
- package/dist/application/contextFactory.js +1 -0
- package/dist/application/dlqManager.d.ts +7 -1
- package/dist/application/dlqManager.js +16 -5
- package/dist/application/lockManager.js +3 -3
- package/dist/application/operations/ack.js +2 -2
- package/dist/application/operations/ackHelpers.js +1 -1
- package/dist/application/operations/jobManagement.js +6 -4
- package/dist/application/operations/jobMoveOperations.js +3 -3
- package/dist/application/operations/jobStateTransitions.d.ts +1 -1
- package/dist/application/operations/jobStateTransitions.js +16 -2
- package/dist/application/queueManager.d.ts +22 -2
- package/dist/application/queueManager.js +48 -6
- package/dist/application/stallDetection.js +3 -3
- package/dist/client/flowJobDependencies.js +3 -1
- package/dist/client/flowJobMoveMethods.js +7 -2
- package/dist/client/jobConversion.d.ts +3 -3
- package/dist/client/jobConversion.js +10 -6
- package/dist/client/jobConversionHelpers.d.ts +1 -1
- package/dist/client/jobConversionHelpers.js +3 -6
- package/dist/client/jobConversionTypes.d.ts +4 -0
- package/dist/client/jobDeduplication.d.ts +6 -0
- package/dist/client/jobDeduplication.js +14 -0
- package/dist/client/queue/bullmqCompat.d.ts +18 -8
- package/dist/client/queue/bullmqCompat.js +39 -71
- package/dist/client/queue/deduplication.d.ts +2 -0
- package/dist/client/queue/deduplication.js +20 -11
- package/dist/client/queue/dlq.d.ts +11 -6
- package/dist/client/queue/dlq.js +47 -4
- package/dist/client/queue/dlqJobMethods.d.ts +9 -0
- package/dist/client/queue/dlqJobMethods.js +176 -0
- package/dist/client/queue/dlqOps.d.ts +2 -1
- package/dist/client/queue/dlqOps.js +2 -2
- package/dist/client/queue/jobMove.js +6 -1
- package/dist/client/queue/jobProxy.js +10 -5
- package/dist/client/queue/operations/add.js +17 -0
- package/dist/client/queue/operations/index.d.ts +1 -0
- package/dist/client/queue/operations/index.js +1 -0
- package/dist/client/queue/operations/management.d.ts +0 -4
- package/dist/client/queue/operations/management.js +33 -5
- package/dist/client/queue/operations/query.d.ts +1 -20
- package/dist/client/queue/operations/query.js +18 -53
- package/dist/client/queue/operations/queryStates.d.ts +13 -0
- package/dist/client/queue/operations/queryStates.js +32 -0
- package/dist/client/queue/operations/queryTcpPages.d.ts +14 -0
- package/dist/client/queue/operations/queryTcpPages.js +40 -0
- package/dist/client/queue/queue.d.ts +3 -0
- package/dist/client/queue/queue.js +23 -11
- package/dist/client/queue/rateLimit.d.ts +4 -4
- package/dist/client/queue/rateLimit.js +17 -8
- package/dist/client/queue/workers.d.ts +12 -0
- package/dist/client/queue/workers.js +20 -2
- package/dist/client/queueGroup.d.ts +11 -0
- package/dist/client/queueGroup.js +28 -1
- package/dist/client/sandboxed/worker.js +1 -1
- package/dist/client/worker/processor.js +1 -1
- package/dist/client/worker/processorHandlers.d.ts +1 -5
- package/dist/client/worker/processorHandlers.js +5 -7
- package/dist/client/worker/worker.d.ts +1 -1
- package/dist/client/worker/worker.js +37 -13
- package/dist/domain/queue/limiterManager.d.ts +11 -0
- package/dist/domain/queue/limiterManager.js +28 -0
- package/dist/domain/queue/shard.d.ts +10 -2
- package/dist/domain/queue/shard.js +23 -4
- package/dist/domain/queue/uniqueKeyManager.d.ts +3 -1
- package/dist/domain/queue/uniqueKeyManager.js +9 -1
- package/dist/domain/types/command.d.ts +34 -1
- package/dist/domain/types/queue.d.ts +5 -0
- package/dist/domain/types/queue.js +13 -0
- package/dist/infrastructure/persistence/sqlite.d.ts +4 -0
- package/dist/infrastructure/persistence/sqlite.js +16 -0
- package/dist/infrastructure/server/handlerRoutes.js +14 -1
- package/dist/infrastructure/server/handlers/dlq.d.ts +3 -0
- package/dist/infrastructure/server/handlers/dlq.js +18 -4
- package/dist/infrastructure/server/handlers/introspection.d.ts +19 -0
- package/dist/infrastructure/server/handlers/introspection.js +21 -0
- package/dist/infrastructure/server/handlers/query.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Queue limit and deduplication introspection handlers. */
|
|
2
|
+
import type { Command } from '../../../domain/types/command';
|
|
3
|
+
import type { Response } from '../../../domain/types/response';
|
|
4
|
+
import type { HandlerContext } from '../types';
|
|
5
|
+
export declare function handleGetQueueLimits(cmd: Extract<Command, {
|
|
6
|
+
cmd: 'GetQueueLimits';
|
|
7
|
+
}>, ctx: HandlerContext, reqId?: string): Response;
|
|
8
|
+
export declare function handleGetDeduplicationJobId(cmd: Extract<Command, {
|
|
9
|
+
cmd: 'GetDeduplicationJobId';
|
|
10
|
+
}>, ctx: HandlerContext, reqId?: string): Response;
|
|
11
|
+
export declare function handleRemoveDeduplicationKey(cmd: Extract<Command, {
|
|
12
|
+
cmd: 'RemoveDeduplicationKey';
|
|
13
|
+
}>, ctx: HandlerContext, reqId?: string): Promise<Response>;
|
|
14
|
+
export declare function handleRemoveJobDeduplicationKey(cmd: Extract<Command, {
|
|
15
|
+
cmd: 'RemoveJobDeduplicationKey';
|
|
16
|
+
}>, ctx: HandlerContext, reqId?: string): Promise<Response>;
|
|
17
|
+
export declare function handleMoveToWaitingChildren(cmd: Extract<Command, {
|
|
18
|
+
cmd: 'MoveToWaitingChildren';
|
|
19
|
+
}>, ctx: HandlerContext, reqId?: string): Promise<Response>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Queue limit and deduplication introspection handlers. */
|
|
2
|
+
import * as resp from '../../../domain/types/response';
|
|
3
|
+
import { jobId } from '../../../domain/types/job';
|
|
4
|
+
export function handleGetQueueLimits(cmd, ctx, reqId) {
|
|
5
|
+
return resp.data({ limits: ctx.queueManager.getQueueLimitStatus(cmd.queue, cmd.maxJobs) }, reqId);
|
|
6
|
+
}
|
|
7
|
+
export function handleGetDeduplicationJobId(cmd, ctx, reqId) {
|
|
8
|
+
return resp.data({ jobId: ctx.queueManager.getDeduplicationJobId(cmd.queue, cmd.deduplicationId) }, reqId);
|
|
9
|
+
}
|
|
10
|
+
export async function handleRemoveDeduplicationKey(cmd, ctx, reqId) {
|
|
11
|
+
const count = await ctx.queueManager.removeDeduplicationKey(cmd.queue, cmd.deduplicationId);
|
|
12
|
+
return resp.data({ count }, reqId);
|
|
13
|
+
}
|
|
14
|
+
export async function handleRemoveJobDeduplicationKey(cmd, ctx, reqId) {
|
|
15
|
+
const removed = await ctx.queueManager.removeJobDeduplicationKey(cmd.id);
|
|
16
|
+
return resp.data({ removed }, reqId);
|
|
17
|
+
}
|
|
18
|
+
export async function handleMoveToWaitingChildren(cmd, ctx, reqId) {
|
|
19
|
+
const moved = await ctx.queueManager.moveToWaitingChildren(jobId(cmd.id));
|
|
20
|
+
return moved ? resp.data({ moved: true }, reqId) : resp.error('Job is not active', reqId);
|
|
21
|
+
}
|
|
@@ -60,7 +60,7 @@ export async function handleGetJobs(cmd, ctx, reqId) {
|
|
|
60
60
|
state: stateFilter,
|
|
61
61
|
start: cmd.offset ?? 0,
|
|
62
62
|
end: (cmd.offset ?? 0) + (cmd.limit ?? 100),
|
|
63
|
-
asc: true,
|
|
63
|
+
asc: cmd.asc ?? true,
|
|
64
64
|
});
|
|
65
65
|
// Inject state into each job for display
|
|
66
66
|
// When state is a single string, use it directly; otherwise resolve per-job
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunqueue",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.54",
|
|
4
4
|
"description": "High-performance job queue for Bun & AI agents. SQLite persistence, cron scheduling, priorities, retries, DLQ, webhooks, native MCP server. Zero external infrastructure.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|