bunqueue 1.0.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/LICENSE +21 -0
- package/README.md +640 -0
- package/dist/application/dlqManager.d.ts +19 -0
- package/dist/application/dlqManager.d.ts.map +1 -0
- package/dist/application/dlqManager.js +44 -0
- package/dist/application/dlqManager.js.map +1 -0
- package/dist/application/eventsManager.d.ts +28 -0
- package/dist/application/eventsManager.d.ts.map +1 -0
- package/dist/application/eventsManager.js +59 -0
- package/dist/application/eventsManager.js.map +1 -0
- package/dist/application/jobLogsManager.d.ts +20 -0
- package/dist/application/jobLogsManager.d.ts.map +1 -0
- package/dist/application/jobLogsManager.js +28 -0
- package/dist/application/jobLogsManager.js.map +1 -0
- package/dist/application/metricsExporter.d.ts +24 -0
- package/dist/application/metricsExporter.d.ts.map +1 -0
- package/dist/application/metricsExporter.js +80 -0
- package/dist/application/metricsExporter.js.map +1 -0
- package/dist/application/operations/ack.d.ts +48 -0
- package/dist/application/operations/ack.d.ts.map +1 -0
- package/dist/application/operations/ack.js +109 -0
- package/dist/application/operations/ack.js.map +1 -0
- package/dist/application/operations/index.d.ts +10 -0
- package/dist/application/operations/index.d.ts.map +1 -0
- package/dist/application/operations/index.js +10 -0
- package/dist/application/operations/index.js.map +1 -0
- package/dist/application/operations/jobManagement.d.ts +32 -0
- package/dist/application/operations/jobManagement.d.ts.map +1 -0
- package/dist/application/operations/jobManagement.js +122 -0
- package/dist/application/operations/jobManagement.js.map +1 -0
- package/dist/application/operations/pull.d.ts +36 -0
- package/dist/application/operations/pull.d.ts.map +1 -0
- package/dist/application/operations/pull.js +109 -0
- package/dist/application/operations/pull.js.map +1 -0
- package/dist/application/operations/push.d.ts +36 -0
- package/dist/application/operations/push.d.ts.map +1 -0
- package/dist/application/operations/push.js +94 -0
- package/dist/application/operations/push.js.map +1 -0
- package/dist/application/operations/queryOperations.d.ts +33 -0
- package/dist/application/operations/queryOperations.d.ts.map +1 -0
- package/dist/application/operations/queryOperations.js +57 -0
- package/dist/application/operations/queryOperations.js.map +1 -0
- package/dist/application/operations/queueControl.d.ts +32 -0
- package/dist/application/operations/queueControl.d.ts.map +1 -0
- package/dist/application/operations/queueControl.js +72 -0
- package/dist/application/operations/queueControl.js.map +1 -0
- package/dist/application/queueManager.d.ts +113 -0
- package/dist/application/queueManager.d.ts.map +1 -0
- package/dist/application/queueManager.js +406 -0
- package/dist/application/queueManager.js.map +1 -0
- package/dist/application/webhookManager.d.ts +35 -0
- package/dist/application/webhookManager.d.ts.map +1 -0
- package/dist/application/webhookManager.js +109 -0
- package/dist/application/webhookManager.js.map +1 -0
- package/dist/application/workerManager.d.ts +48 -0
- package/dist/application/workerManager.d.ts.map +1 -0
- package/dist/application/workerManager.js +121 -0
- package/dist/application/workerManager.js.map +1 -0
- package/dist/domain/queue/index.d.ts +6 -0
- package/dist/domain/queue/index.d.ts.map +1 -0
- package/dist/domain/queue/index.js +6 -0
- package/dist/domain/queue/index.js.map +1 -0
- package/dist/domain/queue/priorityQueue.d.ts +45 -0
- package/dist/domain/queue/priorityQueue.d.ts.map +1 -0
- package/dist/domain/queue/priorityQueue.js +203 -0
- package/dist/domain/queue/priorityQueue.js.map +1 -0
- package/dist/domain/queue/shard.d.ts +98 -0
- package/dist/domain/queue/shard.d.ts.map +1 -0
- package/dist/domain/queue/shard.js +245 -0
- package/dist/domain/queue/shard.js.map +1 -0
- package/dist/domain/types/command.d.ts +270 -0
- package/dist/domain/types/command.d.ts.map +1 -0
- package/dist/domain/types/command.js +6 -0
- package/dist/domain/types/command.js.map +1 -0
- package/dist/domain/types/cron.d.ts +32 -0
- package/dist/domain/types/cron.d.ts.map +1 -0
- package/dist/domain/types/cron.js +31 -0
- package/dist/domain/types/cron.js.map +1 -0
- package/dist/domain/types/index.d.ts +9 -0
- package/dist/domain/types/index.d.ts.map +1 -0
- package/dist/domain/types/index.js +9 -0
- package/dist/domain/types/index.js.map +1 -0
- package/dist/domain/types/job.d.ts +94 -0
- package/dist/domain/types/job.d.ts.map +1 -0
- package/dist/domain/types/job.js +81 -0
- package/dist/domain/types/job.js.map +1 -0
- package/dist/domain/types/queue.d.ts +86 -0
- package/dist/domain/types/queue.d.ts.map +1 -0
- package/dist/domain/types/queue.js +84 -0
- package/dist/domain/types/queue.js.map +1 -0
- package/dist/domain/types/response.d.ts +158 -0
- package/dist/domain/types/response.d.ts.map +1 -0
- package/dist/domain/types/response.js +86 -0
- package/dist/domain/types/response.js.map +1 -0
- package/dist/domain/types/webhook.d.ts +33 -0
- package/dist/domain/types/webhook.d.ts.map +1 -0
- package/dist/domain/types/webhook.js +20 -0
- package/dist/domain/types/webhook.js.map +1 -0
- package/dist/domain/types/worker.d.ts +27 -0
- package/dist/domain/types/worker.d.ts.map +1 -0
- package/dist/domain/types/worker.js +27 -0
- package/dist/domain/types/worker.js.map +1 -0
- package/dist/infrastructure/persistence/index.d.ts +6 -0
- package/dist/infrastructure/persistence/index.d.ts.map +1 -0
- package/dist/infrastructure/persistence/index.js +6 -0
- package/dist/infrastructure/persistence/index.js.map +1 -0
- package/dist/infrastructure/persistence/schema.d.ts +14 -0
- package/dist/infrastructure/persistence/schema.d.ts.map +1 -0
- package/dist/infrastructure/persistence/schema.js +123 -0
- package/dist/infrastructure/persistence/schema.js.map +1 -0
- package/dist/infrastructure/persistence/sqlite.d.ts +42 -0
- package/dist/infrastructure/persistence/sqlite.d.ts.map +1 -0
- package/dist/infrastructure/persistence/sqlite.js +164 -0
- package/dist/infrastructure/persistence/sqlite.js.map +1 -0
- package/dist/infrastructure/persistence/statements.d.ts +55 -0
- package/dist/infrastructure/persistence/statements.d.ts.map +1 -0
- package/dist/infrastructure/persistence/statements.js +42 -0
- package/dist/infrastructure/persistence/statements.js.map +1 -0
- package/dist/infrastructure/scheduler/cronParser.d.ts +44 -0
- package/dist/infrastructure/scheduler/cronParser.d.ts.map +1 -0
- package/dist/infrastructure/scheduler/cronParser.js +90 -0
- package/dist/infrastructure/scheduler/cronParser.js.map +1 -0
- package/dist/infrastructure/scheduler/cronScheduler.d.ts +68 -0
- package/dist/infrastructure/scheduler/cronScheduler.d.ts.map +1 -0
- package/dist/infrastructure/scheduler/cronScheduler.js +172 -0
- package/dist/infrastructure/scheduler/cronScheduler.js.map +1 -0
- package/dist/infrastructure/scheduler/index.d.ts +6 -0
- package/dist/infrastructure/scheduler/index.d.ts.map +1 -0
- package/dist/infrastructure/scheduler/index.js +6 -0
- package/dist/infrastructure/scheduler/index.js.map +1 -0
- package/dist/infrastructure/server/handler.d.ts +13 -0
- package/dist/infrastructure/server/handler.d.ts.map +1 -0
- package/dist/infrastructure/server/handler.js +167 -0
- package/dist/infrastructure/server/handler.js.map +1 -0
- package/dist/infrastructure/server/handlers/advanced.d.ts +68 -0
- package/dist/infrastructure/server/handlers/advanced.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/advanced.js +99 -0
- package/dist/infrastructure/server/handlers/advanced.js.map +1 -0
- package/dist/infrastructure/server/handlers/core.d.ts +36 -0
- package/dist/infrastructure/server/handlers/core.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/core.js +82 -0
- package/dist/infrastructure/server/handlers/core.js.map +1 -0
- package/dist/infrastructure/server/handlers/cron.d.ts +20 -0
- package/dist/infrastructure/server/handlers/cron.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/cron.js +56 -0
- package/dist/infrastructure/server/handlers/cron.js.map +1 -0
- package/dist/infrastructure/server/handlers/dlq.d.ts +20 -0
- package/dist/infrastructure/server/handlers/dlq.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/dlq.js +31 -0
- package/dist/infrastructure/server/handlers/dlq.js.map +1 -0
- package/dist/infrastructure/server/handlers/index.d.ts +7 -0
- package/dist/infrastructure/server/handlers/index.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/index.js +7 -0
- package/dist/infrastructure/server/handlers/index.js.map +1 -0
- package/dist/infrastructure/server/handlers/management.d.ts +36 -0
- package/dist/infrastructure/server/handlers/management.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/management.js +75 -0
- package/dist/infrastructure/server/handlers/management.js.map +1 -0
- package/dist/infrastructure/server/handlers/monitoring.d.ts +18 -0
- package/dist/infrastructure/server/handlers/monitoring.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/monitoring.js +102 -0
- package/dist/infrastructure/server/handlers/monitoring.js.map +1 -0
- package/dist/infrastructure/server/handlers/query.d.ts +32 -0
- package/dist/infrastructure/server/handlers/query.d.ts.map +1 -0
- package/dist/infrastructure/server/handlers/query.js +61 -0
- package/dist/infrastructure/server/handlers/query.js.map +1 -0
- package/dist/infrastructure/server/http.d.ts +43 -0
- package/dist/infrastructure/server/http.d.ts.map +1 -0
- package/dist/infrastructure/server/http.js +344 -0
- package/dist/infrastructure/server/http.js.map +1 -0
- package/dist/infrastructure/server/index.d.ts +8 -0
- package/dist/infrastructure/server/index.d.ts.map +1 -0
- package/dist/infrastructure/server/index.js +8 -0
- package/dist/infrastructure/server/index.js.map +1 -0
- package/dist/infrastructure/server/protocol.d.ts +44 -0
- package/dist/infrastructure/server/protocol.d.ts.map +1 -0
- package/dist/infrastructure/server/protocol.js +129 -0
- package/dist/infrastructure/server/protocol.js.map +1 -0
- package/dist/infrastructure/server/rateLimiter.d.ts +31 -0
- package/dist/infrastructure/server/rateLimiter.d.ts.map +1 -0
- package/dist/infrastructure/server/rateLimiter.js +79 -0
- package/dist/infrastructure/server/rateLimiter.js.map +1 -0
- package/dist/infrastructure/server/tcp.d.ts +36 -0
- package/dist/infrastructure/server/tcp.d.ts.map +1 -0
- package/dist/infrastructure/server/tcp.js +101 -0
- package/dist/infrastructure/server/tcp.js.map +1 -0
- package/dist/infrastructure/server/types.d.ts +11 -0
- package/dist/infrastructure/server/types.d.ts.map +1 -0
- package/dist/infrastructure/server/types.js +5 -0
- package/dist/infrastructure/server/types.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +111 -0
- package/dist/main.js.map +1 -0
- package/dist/shared/hash.d.ts +30 -0
- package/dist/shared/hash.d.ts.map +1 -0
- package/dist/shared/hash.js +69 -0
- package/dist/shared/hash.js.map +1 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +6 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/lock.d.ts +70 -0
- package/dist/shared/lock.d.ts.map +1 -0
- package/dist/shared/lock.js +207 -0
- package/dist/shared/lock.js.map +1 -0
- package/dist/shared/logger.d.ts +38 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +74 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/serialization.d.ts +23 -0
- package/dist/shared/serialization.d.ts.map +1 -0
- package/dist/shared/serialization.js +63 -0
- package/dist/shared/serialization.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shard - Container for queues within a shard
|
|
3
|
+
* Each shard manages multiple queues and their state
|
|
4
|
+
*/
|
|
5
|
+
import type { Job, JobId } from '../types/job';
|
|
6
|
+
import { type QueueState, RateLimiter, ConcurrencyLimiter } from '../types/queue';
|
|
7
|
+
import { IndexedPriorityQueue } from './priorityQueue';
|
|
8
|
+
/**
|
|
9
|
+
* Shard contains:
|
|
10
|
+
* - Queues (waiting + delayed jobs)
|
|
11
|
+
* - DLQ (dead letter queue)
|
|
12
|
+
* - Unique keys tracking
|
|
13
|
+
* - Active FIFO groups
|
|
14
|
+
* - Queue state (paused, rate limit, concurrency)
|
|
15
|
+
*/
|
|
16
|
+
export declare class Shard {
|
|
17
|
+
/** Priority queues by queue name */
|
|
18
|
+
readonly queues: Map<string, IndexedPriorityQueue>;
|
|
19
|
+
/** Dead letter queue by queue name */
|
|
20
|
+
readonly dlq: Map<string, Job[]>;
|
|
21
|
+
/** Unique keys per queue for deduplication */
|
|
22
|
+
readonly uniqueKeys: Map<string, Set<string>>;
|
|
23
|
+
/** Jobs waiting for dependencies */
|
|
24
|
+
readonly waitingDeps: Map<JobId, Job>;
|
|
25
|
+
/** Parent jobs waiting for children to complete */
|
|
26
|
+
readonly waitingChildren: Map<JobId, Job>;
|
|
27
|
+
/** Queue state (pause, rate limit, concurrency) */
|
|
28
|
+
readonly queueState: Map<string, QueueState>;
|
|
29
|
+
/** Active FIFO groups per queue */
|
|
30
|
+
readonly activeGroups: Map<string, Set<string>>;
|
|
31
|
+
/** Rate limiters per queue */
|
|
32
|
+
readonly rateLimiters: Map<string, RateLimiter>;
|
|
33
|
+
/** Concurrency limiters per queue */
|
|
34
|
+
readonly concurrencyLimiters: Map<string, ConcurrencyLimiter>;
|
|
35
|
+
/** Notification callback for new jobs */
|
|
36
|
+
private notifyCallback;
|
|
37
|
+
/** Set notification callback */
|
|
38
|
+
onNotify(callback: () => void): void;
|
|
39
|
+
/** Notify that jobs are available */
|
|
40
|
+
notify(): void;
|
|
41
|
+
/** Get or create queue */
|
|
42
|
+
getQueue(name: string): IndexedPriorityQueue;
|
|
43
|
+
/** Get queue state */
|
|
44
|
+
getState(name: string): QueueState;
|
|
45
|
+
/** Check if queue is paused */
|
|
46
|
+
isPaused(name: string): boolean;
|
|
47
|
+
/** Pause queue */
|
|
48
|
+
pause(name: string): void;
|
|
49
|
+
/** Resume queue */
|
|
50
|
+
resume(name: string): void;
|
|
51
|
+
/** Check if unique key is available */
|
|
52
|
+
isUniqueAvailable(queue: string, key: string): boolean;
|
|
53
|
+
/** Register unique key */
|
|
54
|
+
registerUniqueKey(queue: string, key: string): void;
|
|
55
|
+
/** Release unique key */
|
|
56
|
+
releaseUniqueKey(queue: string, key: string): void;
|
|
57
|
+
/** Check if FIFO group is active */
|
|
58
|
+
isGroupActive(queue: string, groupId: string): boolean;
|
|
59
|
+
/** Mark FIFO group as active */
|
|
60
|
+
activateGroup(queue: string, groupId: string): void;
|
|
61
|
+
/** Release FIFO group */
|
|
62
|
+
releaseGroup(queue: string, groupId: string): void;
|
|
63
|
+
/** Set rate limit for queue */
|
|
64
|
+
setRateLimit(queue: string, limit: number): void;
|
|
65
|
+
/** Clear rate limit */
|
|
66
|
+
clearRateLimit(queue: string): void;
|
|
67
|
+
/** Try to acquire rate limit token */
|
|
68
|
+
tryAcquireRateLimit(queue: string): boolean;
|
|
69
|
+
/** Set concurrency limit for queue */
|
|
70
|
+
setConcurrency(queue: string, limit: number): void;
|
|
71
|
+
/** Clear concurrency limit */
|
|
72
|
+
clearConcurrency(queue: string): void;
|
|
73
|
+
/** Try to acquire concurrency slot */
|
|
74
|
+
tryAcquireConcurrency(queue: string): boolean;
|
|
75
|
+
/** Release concurrency slot */
|
|
76
|
+
releaseConcurrency(queue: string): void;
|
|
77
|
+
/** Release all resources for a job */
|
|
78
|
+
releaseJobResources(queue: string, uniqueKey: string | null, groupId: string | null): void;
|
|
79
|
+
/** Add job to DLQ */
|
|
80
|
+
addToDlq(job: Job): void;
|
|
81
|
+
/** Get DLQ jobs */
|
|
82
|
+
getDlq(queue: string, count?: number): Job[];
|
|
83
|
+
/** Remove job from DLQ */
|
|
84
|
+
removeFromDlq(queue: string, jobId: JobId): Job | null;
|
|
85
|
+
/** Clear DLQ for queue */
|
|
86
|
+
clearDlq(queue: string): number;
|
|
87
|
+
/** Get waiting job count for queue */
|
|
88
|
+
getWaitingCount(queue: string): number;
|
|
89
|
+
/** Get DLQ count for queue */
|
|
90
|
+
getDlqCount(queue: string): number;
|
|
91
|
+
/** Get all queue names in this shard */
|
|
92
|
+
getQueueNames(): string[];
|
|
93
|
+
/** Drain all waiting jobs from queue */
|
|
94
|
+
drain(queue: string): number;
|
|
95
|
+
/** Obliterate queue completely */
|
|
96
|
+
obliterate(queue: string): void;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=shard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shard.d.ts","sourceRoot":"","sources":["../../../src/domain/queue/shard.ts"],"names":[],"mappings":"AAAA;;;GAGG;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AAE,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE;IAM5C,0BAA0B;IAC1B,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,IAAI;IAQtD,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAU/B,sCAAsC;IACtC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAItC,8BAA8B;IAC9B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlC,wCAAwC;IACxC,aAAa,IAAI,MAAM,EAAE;IAQzB,wCAAwC;IACxC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQ5B,kCAAkC;IAClC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAShC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shard - Container for queues within a shard
|
|
3
|
+
* Each shard manages multiple queues and their state
|
|
4
|
+
*/
|
|
5
|
+
import { createQueueState, RateLimiter, ConcurrencyLimiter } from '../types/queue';
|
|
6
|
+
import { IndexedPriorityQueue } from './priorityQueue';
|
|
7
|
+
/**
|
|
8
|
+
* Shard contains:
|
|
9
|
+
* - Queues (waiting + delayed jobs)
|
|
10
|
+
* - DLQ (dead letter queue)
|
|
11
|
+
* - Unique keys tracking
|
|
12
|
+
* - Active FIFO groups
|
|
13
|
+
* - Queue state (paused, rate limit, concurrency)
|
|
14
|
+
*/
|
|
15
|
+
export class Shard {
|
|
16
|
+
/** Priority queues by queue name */
|
|
17
|
+
queues = new Map();
|
|
18
|
+
/** Dead letter queue by queue name */
|
|
19
|
+
dlq = new Map();
|
|
20
|
+
/** Unique keys per queue for deduplication */
|
|
21
|
+
uniqueKeys = new Map();
|
|
22
|
+
/** Jobs waiting for dependencies */
|
|
23
|
+
waitingDeps = new Map();
|
|
24
|
+
/** Parent jobs waiting for children to complete */
|
|
25
|
+
waitingChildren = new Map();
|
|
26
|
+
/** Queue state (pause, rate limit, concurrency) */
|
|
27
|
+
queueState = new Map();
|
|
28
|
+
/** Active FIFO groups per queue */
|
|
29
|
+
activeGroups = new Map();
|
|
30
|
+
/** Rate limiters per queue */
|
|
31
|
+
rateLimiters = new Map();
|
|
32
|
+
/** Concurrency limiters per queue */
|
|
33
|
+
concurrencyLimiters = new Map();
|
|
34
|
+
/** Notification callback for new jobs */
|
|
35
|
+
notifyCallback = null;
|
|
36
|
+
/** Set notification callback */
|
|
37
|
+
onNotify(callback) {
|
|
38
|
+
this.notifyCallback = callback;
|
|
39
|
+
}
|
|
40
|
+
/** Notify that jobs are available */
|
|
41
|
+
notify() {
|
|
42
|
+
this.notifyCallback?.();
|
|
43
|
+
}
|
|
44
|
+
// ============ Queue Operations ============
|
|
45
|
+
/** Get or create queue */
|
|
46
|
+
getQueue(name) {
|
|
47
|
+
let queue = this.queues.get(name);
|
|
48
|
+
if (!queue) {
|
|
49
|
+
queue = new IndexedPriorityQueue();
|
|
50
|
+
this.queues.set(name, queue);
|
|
51
|
+
}
|
|
52
|
+
return queue;
|
|
53
|
+
}
|
|
54
|
+
/** Get queue state */
|
|
55
|
+
getState(name) {
|
|
56
|
+
let state = this.queueState.get(name);
|
|
57
|
+
if (!state) {
|
|
58
|
+
state = createQueueState(name);
|
|
59
|
+
this.queueState.set(name, state);
|
|
60
|
+
}
|
|
61
|
+
return state;
|
|
62
|
+
}
|
|
63
|
+
/** Check if queue is paused */
|
|
64
|
+
isPaused(name) {
|
|
65
|
+
return this.queueState.get(name)?.paused ?? false;
|
|
66
|
+
}
|
|
67
|
+
/** Pause queue */
|
|
68
|
+
pause(name) {
|
|
69
|
+
this.getState(name).paused = true;
|
|
70
|
+
}
|
|
71
|
+
/** Resume queue */
|
|
72
|
+
resume(name) {
|
|
73
|
+
this.getState(name).paused = false;
|
|
74
|
+
this.notify();
|
|
75
|
+
}
|
|
76
|
+
// ============ Unique Key Management ============
|
|
77
|
+
/** Check if unique key is available */
|
|
78
|
+
isUniqueAvailable(queue, key) {
|
|
79
|
+
return !this.uniqueKeys.get(queue)?.has(key);
|
|
80
|
+
}
|
|
81
|
+
/** Register unique key */
|
|
82
|
+
registerUniqueKey(queue, key) {
|
|
83
|
+
let keys = this.uniqueKeys.get(queue);
|
|
84
|
+
if (!keys) {
|
|
85
|
+
keys = new Set();
|
|
86
|
+
this.uniqueKeys.set(queue, keys);
|
|
87
|
+
}
|
|
88
|
+
keys.add(key);
|
|
89
|
+
}
|
|
90
|
+
/** Release unique key */
|
|
91
|
+
releaseUniqueKey(queue, key) {
|
|
92
|
+
this.uniqueKeys.get(queue)?.delete(key);
|
|
93
|
+
}
|
|
94
|
+
// ============ FIFO Group Management ============
|
|
95
|
+
/** Check if FIFO group is active */
|
|
96
|
+
isGroupActive(queue, groupId) {
|
|
97
|
+
return this.activeGroups.get(queue)?.has(groupId) ?? false;
|
|
98
|
+
}
|
|
99
|
+
/** Mark FIFO group as active */
|
|
100
|
+
activateGroup(queue, groupId) {
|
|
101
|
+
let groups = this.activeGroups.get(queue);
|
|
102
|
+
if (!groups) {
|
|
103
|
+
groups = new Set();
|
|
104
|
+
this.activeGroups.set(queue, groups);
|
|
105
|
+
}
|
|
106
|
+
groups.add(groupId);
|
|
107
|
+
}
|
|
108
|
+
/** Release FIFO group */
|
|
109
|
+
releaseGroup(queue, groupId) {
|
|
110
|
+
this.activeGroups.get(queue)?.delete(groupId);
|
|
111
|
+
}
|
|
112
|
+
// ============ Rate & Concurrency Limiting ============
|
|
113
|
+
/** Set rate limit for queue */
|
|
114
|
+
setRateLimit(queue, limit) {
|
|
115
|
+
this.rateLimiters.set(queue, new RateLimiter(limit));
|
|
116
|
+
this.getState(queue).rateLimit = limit;
|
|
117
|
+
}
|
|
118
|
+
/** Clear rate limit */
|
|
119
|
+
clearRateLimit(queue) {
|
|
120
|
+
this.rateLimiters.delete(queue);
|
|
121
|
+
const state = this.queueState.get(queue);
|
|
122
|
+
if (state)
|
|
123
|
+
state.rateLimit = null;
|
|
124
|
+
}
|
|
125
|
+
/** Try to acquire rate limit token */
|
|
126
|
+
tryAcquireRateLimit(queue) {
|
|
127
|
+
const limiter = this.rateLimiters.get(queue);
|
|
128
|
+
return !limiter || limiter.tryAcquire();
|
|
129
|
+
}
|
|
130
|
+
/** Set concurrency limit for queue */
|
|
131
|
+
setConcurrency(queue, limit) {
|
|
132
|
+
let limiter = this.concurrencyLimiters.get(queue);
|
|
133
|
+
if (limiter) {
|
|
134
|
+
limiter.setLimit(limit);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
limiter = new ConcurrencyLimiter(limit);
|
|
138
|
+
this.concurrencyLimiters.set(queue, limiter);
|
|
139
|
+
}
|
|
140
|
+
this.getState(queue).concurrencyLimit = limit;
|
|
141
|
+
}
|
|
142
|
+
/** Clear concurrency limit */
|
|
143
|
+
clearConcurrency(queue) {
|
|
144
|
+
this.concurrencyLimiters.delete(queue);
|
|
145
|
+
const state = this.queueState.get(queue);
|
|
146
|
+
if (state)
|
|
147
|
+
state.concurrencyLimit = null;
|
|
148
|
+
}
|
|
149
|
+
/** Try to acquire concurrency slot */
|
|
150
|
+
tryAcquireConcurrency(queue) {
|
|
151
|
+
const limiter = this.concurrencyLimiters.get(queue);
|
|
152
|
+
return !limiter || limiter.tryAcquire();
|
|
153
|
+
}
|
|
154
|
+
/** Release concurrency slot */
|
|
155
|
+
releaseConcurrency(queue) {
|
|
156
|
+
this.concurrencyLimiters.get(queue)?.release();
|
|
157
|
+
}
|
|
158
|
+
// ============ Resource Release ============
|
|
159
|
+
/** Release all resources for a job */
|
|
160
|
+
releaseJobResources(queue, uniqueKey, groupId) {
|
|
161
|
+
if (uniqueKey) {
|
|
162
|
+
this.releaseUniqueKey(queue, uniqueKey);
|
|
163
|
+
}
|
|
164
|
+
if (groupId) {
|
|
165
|
+
this.releaseGroup(queue, groupId);
|
|
166
|
+
}
|
|
167
|
+
this.releaseConcurrency(queue);
|
|
168
|
+
}
|
|
169
|
+
// ============ DLQ Operations ============
|
|
170
|
+
/** Add job to DLQ */
|
|
171
|
+
addToDlq(job) {
|
|
172
|
+
let dlq = this.dlq.get(job.queue);
|
|
173
|
+
if (!dlq) {
|
|
174
|
+
dlq = [];
|
|
175
|
+
this.dlq.set(job.queue, dlq);
|
|
176
|
+
}
|
|
177
|
+
dlq.push(job);
|
|
178
|
+
}
|
|
179
|
+
/** Get DLQ jobs */
|
|
180
|
+
getDlq(queue, count) {
|
|
181
|
+
const dlq = this.dlq.get(queue);
|
|
182
|
+
if (!dlq)
|
|
183
|
+
return [];
|
|
184
|
+
return count ? dlq.slice(0, count) : [...dlq];
|
|
185
|
+
}
|
|
186
|
+
/** Remove job from DLQ */
|
|
187
|
+
removeFromDlq(queue, jobId) {
|
|
188
|
+
const dlq = this.dlq.get(queue);
|
|
189
|
+
if (!dlq)
|
|
190
|
+
return null;
|
|
191
|
+
const idx = dlq.findIndex((j) => j.id === jobId);
|
|
192
|
+
if (idx === -1)
|
|
193
|
+
return null;
|
|
194
|
+
return dlq.splice(idx, 1)[0];
|
|
195
|
+
}
|
|
196
|
+
/** Clear DLQ for queue */
|
|
197
|
+
clearDlq(queue) {
|
|
198
|
+
const dlq = this.dlq.get(queue);
|
|
199
|
+
if (!dlq)
|
|
200
|
+
return 0;
|
|
201
|
+
const count = dlq.length;
|
|
202
|
+
this.dlq.delete(queue);
|
|
203
|
+
return count;
|
|
204
|
+
}
|
|
205
|
+
// ============ Queue Stats ============
|
|
206
|
+
/** Get waiting job count for queue */
|
|
207
|
+
getWaitingCount(queue) {
|
|
208
|
+
return this.queues.get(queue)?.size ?? 0;
|
|
209
|
+
}
|
|
210
|
+
/** Get DLQ count for queue */
|
|
211
|
+
getDlqCount(queue) {
|
|
212
|
+
return this.dlq.get(queue)?.length ?? 0;
|
|
213
|
+
}
|
|
214
|
+
/** Get all queue names in this shard */
|
|
215
|
+
getQueueNames() {
|
|
216
|
+
const names = new Set();
|
|
217
|
+
for (const name of this.queues.keys())
|
|
218
|
+
names.add(name);
|
|
219
|
+
for (const name of this.dlq.keys())
|
|
220
|
+
names.add(name);
|
|
221
|
+
for (const name of this.queueState.keys())
|
|
222
|
+
names.add(name);
|
|
223
|
+
return Array.from(names);
|
|
224
|
+
}
|
|
225
|
+
/** Drain all waiting jobs from queue */
|
|
226
|
+
drain(queue) {
|
|
227
|
+
const q = this.queues.get(queue);
|
|
228
|
+
if (!q)
|
|
229
|
+
return 0;
|
|
230
|
+
const count = q.size;
|
|
231
|
+
q.clear();
|
|
232
|
+
return count;
|
|
233
|
+
}
|
|
234
|
+
/** Obliterate queue completely */
|
|
235
|
+
obliterate(queue) {
|
|
236
|
+
this.queues.delete(queue);
|
|
237
|
+
this.dlq.delete(queue);
|
|
238
|
+
this.uniqueKeys.delete(queue);
|
|
239
|
+
this.queueState.delete(queue);
|
|
240
|
+
this.activeGroups.delete(queue);
|
|
241
|
+
this.rateLimiters.delete(queue);
|
|
242
|
+
this.concurrencyLimiters.delete(queue);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=shard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shard.js","sourceRoot":"","sources":["../../../src/domain/queue/shard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAmB,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,OAAO,KAAK;IAChB,oCAAoC;IAC3B,MAAM,GAAG,IAAI,GAAG,EAAgC,CAAC;IAE1D,sCAAsC;IAC7B,GAAG,GAAG,IAAI,GAAG,EAAiB,CAAC;IAExC,8CAA8C;IACrC,UAAU,GAAG,IAAI,GAAG,EAAuB,CAAC;IAErD,oCAAoC;IAC3B,WAAW,GAAG,IAAI,GAAG,EAAc,CAAC;IAE7C,mDAAmD;IA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AC,CAAC;QACjC,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QACjB,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;QACrB,CAAC,CAAC,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kCAAkC;IAClC,UAAU,CAAC,KAAa;QACtB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol commands
|
|
3
|
+
* All supported commands for TCP/HTTP protocol
|
|
4
|
+
*/
|
|
5
|
+
import type { JobInput, JobState } from './job';
|
|
6
|
+
/** Base command interface */
|
|
7
|
+
interface BaseCommand {
|
|
8
|
+
readonly cmd: string;
|
|
9
|
+
readonly reqId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PushCommand extends BaseCommand {
|
|
12
|
+
readonly cmd: 'PUSH';
|
|
13
|
+
readonly queue: string;
|
|
14
|
+
readonly data: unknown;
|
|
15
|
+
readonly priority?: number;
|
|
16
|
+
readonly delay?: number;
|
|
17
|
+
readonly maxAttempts?: number;
|
|
18
|
+
readonly backoff?: number;
|
|
19
|
+
readonly ttl?: number;
|
|
20
|
+
readonly timeout?: number;
|
|
21
|
+
readonly uniqueKey?: string;
|
|
22
|
+
readonly jobId?: string;
|
|
23
|
+
readonly dependsOn?: string[];
|
|
24
|
+
readonly tags?: string[];
|
|
25
|
+
readonly groupId?: string;
|
|
26
|
+
readonly lifo?: boolean;
|
|
27
|
+
readonly removeOnComplete?: boolean;
|
|
28
|
+
readonly removeOnFail?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface PushBatchCommand extends BaseCommand {
|
|
31
|
+
readonly cmd: 'PUSHB';
|
|
32
|
+
readonly queue: string;
|
|
33
|
+
readonly jobs: JobInput[];
|
|
34
|
+
}
|
|
35
|
+
export interface PullCommand extends BaseCommand {
|
|
36
|
+
readonly cmd: 'PULL';
|
|
37
|
+
readonly queue: string;
|
|
38
|
+
readonly timeout?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface PullBatchCommand extends BaseCommand {
|
|
41
|
+
readonly cmd: 'PULLB';
|
|
42
|
+
readonly queue: string;
|
|
43
|
+
readonly count: number;
|
|
44
|
+
readonly timeout?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface AckCommand extends BaseCommand {
|
|
47
|
+
readonly cmd: 'ACK';
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly result?: unknown;
|
|
50
|
+
}
|
|
51
|
+
export interface AckBatchCommand extends BaseCommand {
|
|
52
|
+
readonly cmd: 'ACKB';
|
|
53
|
+
readonly ids: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface FailCommand extends BaseCommand {
|
|
56
|
+
readonly cmd: 'FAIL';
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly error?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface GetJobCommand extends BaseCommand {
|
|
61
|
+
readonly cmd: 'GetJob';
|
|
62
|
+
readonly id: string;
|
|
63
|
+
}
|
|
64
|
+
export interface GetStateCommand extends BaseCommand {
|
|
65
|
+
readonly cmd: 'GetState';
|
|
66
|
+
readonly id: string;
|
|
67
|
+
}
|
|
68
|
+
export interface GetResultCommand extends BaseCommand {
|
|
69
|
+
readonly cmd: 'GetResult';
|
|
70
|
+
readonly id: string;
|
|
71
|
+
}
|
|
72
|
+
export interface GetJobsCommand extends BaseCommand {
|
|
73
|
+
readonly cmd: 'GetJobs';
|
|
74
|
+
readonly queue: string;
|
|
75
|
+
readonly state?: JobState;
|
|
76
|
+
readonly limit?: number;
|
|
77
|
+
readonly offset?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface GetJobCountsCommand extends BaseCommand {
|
|
80
|
+
readonly cmd: 'GetJobCounts';
|
|
81
|
+
readonly queue: string;
|
|
82
|
+
}
|
|
83
|
+
export interface GetJobByCustomIdCommand extends BaseCommand {
|
|
84
|
+
readonly cmd: 'GetJobByCustomId';
|
|
85
|
+
readonly customId: string;
|
|
86
|
+
}
|
|
87
|
+
export interface CountCommand extends BaseCommand {
|
|
88
|
+
readonly cmd: 'Count';
|
|
89
|
+
readonly queue: string;
|
|
90
|
+
}
|
|
91
|
+
export interface GetProgressCommand extends BaseCommand {
|
|
92
|
+
readonly cmd: 'GetProgress';
|
|
93
|
+
readonly id: string;
|
|
94
|
+
}
|
|
95
|
+
export interface CancelCommand extends BaseCommand {
|
|
96
|
+
readonly cmd: 'Cancel';
|
|
97
|
+
readonly id: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ProgressCommand extends BaseCommand {
|
|
100
|
+
readonly cmd: 'Progress';
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly progress: number;
|
|
103
|
+
readonly message?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface UpdateCommand extends BaseCommand {
|
|
106
|
+
readonly cmd: 'Update';
|
|
107
|
+
readonly id: string;
|
|
108
|
+
readonly data: unknown;
|
|
109
|
+
}
|
|
110
|
+
export interface ChangePriorityCommand extends BaseCommand {
|
|
111
|
+
readonly cmd: 'ChangePriority';
|
|
112
|
+
readonly id: string;
|
|
113
|
+
readonly priority: number;
|
|
114
|
+
}
|
|
115
|
+
export interface PromoteCommand extends BaseCommand {
|
|
116
|
+
readonly cmd: 'Promote';
|
|
117
|
+
readonly id: string;
|
|
118
|
+
}
|
|
119
|
+
export interface WaitJobCommand extends BaseCommand {
|
|
120
|
+
readonly cmd: 'WaitJob';
|
|
121
|
+
readonly id: string;
|
|
122
|
+
readonly timeout?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface MoveToDelayedCommand extends BaseCommand {
|
|
125
|
+
readonly cmd: 'MoveToDelayed';
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly delay: number;
|
|
128
|
+
}
|
|
129
|
+
export interface DiscardCommand extends BaseCommand {
|
|
130
|
+
readonly cmd: 'Discard';
|
|
131
|
+
readonly id: string;
|
|
132
|
+
}
|
|
133
|
+
export interface PauseCommand extends BaseCommand {
|
|
134
|
+
readonly cmd: 'Pause';
|
|
135
|
+
readonly queue: string;
|
|
136
|
+
}
|
|
137
|
+
export interface ResumeCommand extends BaseCommand {
|
|
138
|
+
readonly cmd: 'Resume';
|
|
139
|
+
readonly queue: string;
|
|
140
|
+
}
|
|
141
|
+
export interface IsPausedCommand extends BaseCommand {
|
|
142
|
+
readonly cmd: 'IsPaused';
|
|
143
|
+
readonly queue: string;
|
|
144
|
+
}
|
|
145
|
+
export interface DrainCommand extends BaseCommand {
|
|
146
|
+
readonly cmd: 'Drain';
|
|
147
|
+
readonly queue: string;
|
|
148
|
+
}
|
|
149
|
+
export interface ObliterateCommand extends BaseCommand {
|
|
150
|
+
readonly cmd: 'Obliterate';
|
|
151
|
+
readonly queue: string;
|
|
152
|
+
}
|
|
153
|
+
export interface ListQueuesCommand extends BaseCommand {
|
|
154
|
+
readonly cmd: 'ListQueues';
|
|
155
|
+
}
|
|
156
|
+
export interface CleanCommand extends BaseCommand {
|
|
157
|
+
readonly cmd: 'Clean';
|
|
158
|
+
readonly queue: string;
|
|
159
|
+
readonly grace: number;
|
|
160
|
+
readonly state?: JobState;
|
|
161
|
+
readonly limit?: number;
|
|
162
|
+
}
|
|
163
|
+
export interface DlqCommand extends BaseCommand {
|
|
164
|
+
readonly cmd: 'Dlq';
|
|
165
|
+
readonly queue: string;
|
|
166
|
+
readonly count?: number;
|
|
167
|
+
}
|
|
168
|
+
export interface RetryDlqCommand extends BaseCommand {
|
|
169
|
+
readonly cmd: 'RetryDlq';
|
|
170
|
+
readonly queue: string;
|
|
171
|
+
readonly jobId?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface PurgeDlqCommand extends BaseCommand {
|
|
174
|
+
readonly cmd: 'PurgeDlq';
|
|
175
|
+
readonly queue: string;
|
|
176
|
+
}
|
|
177
|
+
export interface RateLimitCommand extends BaseCommand {
|
|
178
|
+
readonly cmd: 'RateLimit';
|
|
179
|
+
readonly queue: string;
|
|
180
|
+
readonly limit: number;
|
|
181
|
+
}
|
|
182
|
+
export interface SetConcurrencyCommand extends BaseCommand {
|
|
183
|
+
readonly cmd: 'SetConcurrency';
|
|
184
|
+
readonly queue: string;
|
|
185
|
+
readonly limit: number;
|
|
186
|
+
}
|
|
187
|
+
export interface RateLimitClearCommand extends BaseCommand {
|
|
188
|
+
readonly cmd: 'RateLimitClear';
|
|
189
|
+
readonly queue: string;
|
|
190
|
+
}
|
|
191
|
+
export interface ClearConcurrencyCommand extends BaseCommand {
|
|
192
|
+
readonly cmd: 'ClearConcurrency';
|
|
193
|
+
readonly queue: string;
|
|
194
|
+
}
|
|
195
|
+
export interface CronCommand extends BaseCommand {
|
|
196
|
+
readonly cmd: 'Cron';
|
|
197
|
+
readonly name: string;
|
|
198
|
+
readonly queue: string;
|
|
199
|
+
readonly data: unknown;
|
|
200
|
+
readonly schedule?: string;
|
|
201
|
+
readonly repeatEvery?: number;
|
|
202
|
+
readonly priority?: number;
|
|
203
|
+
readonly maxLimit?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface CronDeleteCommand extends BaseCommand {
|
|
206
|
+
readonly cmd: 'CronDelete';
|
|
207
|
+
readonly name: string;
|
|
208
|
+
}
|
|
209
|
+
export interface CronListCommand extends BaseCommand {
|
|
210
|
+
readonly cmd: 'CronList';
|
|
211
|
+
}
|
|
212
|
+
export interface AddLogCommand extends BaseCommand {
|
|
213
|
+
readonly cmd: 'AddLog';
|
|
214
|
+
readonly id: string;
|
|
215
|
+
readonly message: string;
|
|
216
|
+
readonly level?: 'info' | 'warn' | 'error';
|
|
217
|
+
}
|
|
218
|
+
export interface GetLogsCommand extends BaseCommand {
|
|
219
|
+
readonly cmd: 'GetLogs';
|
|
220
|
+
readonly id: string;
|
|
221
|
+
}
|
|
222
|
+
export interface HeartbeatCommand extends BaseCommand {
|
|
223
|
+
readonly cmd: 'Heartbeat';
|
|
224
|
+
readonly id: string;
|
|
225
|
+
}
|
|
226
|
+
export interface RegisterWorkerCommand extends BaseCommand {
|
|
227
|
+
readonly cmd: 'RegisterWorker';
|
|
228
|
+
readonly name: string;
|
|
229
|
+
readonly queues: string[];
|
|
230
|
+
}
|
|
231
|
+
export interface UnregisterWorkerCommand extends BaseCommand {
|
|
232
|
+
readonly cmd: 'UnregisterWorker';
|
|
233
|
+
readonly workerId: string;
|
|
234
|
+
}
|
|
235
|
+
export interface ListWorkersCommand extends BaseCommand {
|
|
236
|
+
readonly cmd: 'ListWorkers';
|
|
237
|
+
}
|
|
238
|
+
export interface AddWebhookCommand extends BaseCommand {
|
|
239
|
+
readonly cmd: 'AddWebhook';
|
|
240
|
+
readonly url: string;
|
|
241
|
+
readonly events: string[];
|
|
242
|
+
readonly queue?: string;
|
|
243
|
+
readonly secret?: string;
|
|
244
|
+
}
|
|
245
|
+
export interface RemoveWebhookCommand extends BaseCommand {
|
|
246
|
+
readonly cmd: 'RemoveWebhook';
|
|
247
|
+
readonly webhookId: string;
|
|
248
|
+
}
|
|
249
|
+
export interface ListWebhooksCommand extends BaseCommand {
|
|
250
|
+
readonly cmd: 'ListWebhooks';
|
|
251
|
+
}
|
|
252
|
+
export interface StatsCommand extends BaseCommand {
|
|
253
|
+
readonly cmd: 'Stats';
|
|
254
|
+
}
|
|
255
|
+
export interface MetricsCommand extends BaseCommand {
|
|
256
|
+
readonly cmd: 'Metrics';
|
|
257
|
+
}
|
|
258
|
+
export interface PrometheusCommand extends BaseCommand {
|
|
259
|
+
readonly cmd: 'Prometheus';
|
|
260
|
+
}
|
|
261
|
+
export interface AuthCommand extends BaseCommand {
|
|
262
|
+
readonly cmd: 'Auth';
|
|
263
|
+
readonly token: string;
|
|
264
|
+
}
|
|
265
|
+
/** Union of all commands */
|
|
266
|
+
export type Command = PushCommand | PushBatchCommand | PullCommand | PullBatchCommand | AckCommand | AckBatchCommand | FailCommand | GetJobCommand | GetStateCommand | GetResultCommand | GetJobsCommand | GetJobCountsCommand | GetJobByCustomIdCommand | CountCommand | GetProgressCommand | CancelCommand | ProgressCommand | UpdateCommand | ChangePriorityCommand | PromoteCommand | WaitJobCommand | MoveToDelayedCommand | DiscardCommand | PauseCommand | ResumeCommand | IsPausedCommand | DrainCommand | ObliterateCommand | ListQueuesCommand | CleanCommand | DlqCommand | RetryDlqCommand | PurgeDlqCommand | RateLimitCommand | SetConcurrencyCommand | RateLimitClearCommand | ClearConcurrencyCommand | CronCommand | CronDeleteCommand | CronListCommand | AddLogCommand | GetLogsCommand | HeartbeatCommand | RegisterWorkerCommand | UnregisterWorkerCommand | ListWorkersCommand | AddWebhookCommand | RemoveWebhookCommand | ListWebhooksCommand | StatsCommand | MetricsCommand | PrometheusCommand | AuthCommand;
|
|
267
|
+
/** Extract command type */
|
|
268
|
+
export type CommandType = Command['cmd'];
|
|
269
|
+
export {};
|
|
270
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/domain/types/command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhD,6BAA6B;AAC7B,UAAU,WAAW;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WA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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/domain/types/command.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|