power-queues 2.0.4 → 2.0.5
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/index.cjs +466 -523
- package/dist/index.d.cts +67 -13
- package/dist/index.d.ts +67 -13
- package/dist/index.js +466 -523
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { PowerRedis,
|
|
2
|
-
|
|
3
|
-
declare const PowerQueues_base: any;
|
|
4
|
-
declare class PowerQueues extends PowerQueues_base {
|
|
5
|
-
abort: AbortController;
|
|
6
|
-
redis: PowerRedis;
|
|
7
|
-
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
8
|
-
onExecute(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
9
|
-
onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
10
|
-
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
11
|
-
runQueue(): Promise<void>;
|
|
12
|
-
consumerLoop(): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import { JsonPrimitiveOrUndefined, PowerRedis, IORedisLike } from 'power-redis';
|
|
14
2
|
|
|
3
|
+
type SavedScript = {
|
|
4
|
+
codeReady?: string;
|
|
5
|
+
codeBody: string;
|
|
6
|
+
};
|
|
15
7
|
type AddTasksOptions = {
|
|
16
8
|
nomkstream?: boolean;
|
|
17
9
|
maxlen?: number;
|
|
@@ -36,4 +28,66 @@ type Task = {
|
|
|
36
28
|
idemKey?: string;
|
|
37
29
|
};
|
|
38
30
|
|
|
31
|
+
declare class PowerQueues extends PowerRedis {
|
|
32
|
+
abort: AbortController;
|
|
33
|
+
redis: IORedisLike;
|
|
34
|
+
readonly strictCheckingConnection: boolean;
|
|
35
|
+
readonly scripts: Record<string, SavedScript>;
|
|
36
|
+
readonly addingBatchTasksCount: number;
|
|
37
|
+
readonly addingBatchKeysLimit: number;
|
|
38
|
+
readonly idemOn: boolean;
|
|
39
|
+
readonly idemKey: string;
|
|
40
|
+
readonly workerExecuteLockTimeoutMs: number;
|
|
41
|
+
readonly workerCacheTaskTimeoutMs: number;
|
|
42
|
+
readonly approveBatchTasksCount: number;
|
|
43
|
+
readonly removeOnExecuted: boolean;
|
|
44
|
+
readonly executeBatchAtOnce: boolean;
|
|
45
|
+
readonly executeJobStatus: boolean;
|
|
46
|
+
readonly executeJobStatusTtlSec: number;
|
|
47
|
+
readonly consumerHost: string;
|
|
48
|
+
readonly stream: string;
|
|
49
|
+
readonly group: string;
|
|
50
|
+
readonly workerBatchTasksCount: number;
|
|
51
|
+
readonly recoveryStuckTasksTimeoutMs: number;
|
|
52
|
+
readonly workerLoopIntervalMs: number;
|
|
53
|
+
readonly workerSelectionTimeoutMs: number;
|
|
54
|
+
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
55
|
+
onExecute(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
56
|
+
onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
57
|
+
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
58
|
+
runQueue(): Promise<void>;
|
|
59
|
+
consumerLoop(): Promise<void>;
|
|
60
|
+
addTasks(queueName: string, data: any[], opts?: AddTasksOptions): Promise<string[]>;
|
|
61
|
+
loadScripts(full?: boolean): Promise<void>;
|
|
62
|
+
private loadScript;
|
|
63
|
+
private saveScript;
|
|
64
|
+
private runScript;
|
|
65
|
+
private xaddBatch;
|
|
66
|
+
private payloadBatch;
|
|
67
|
+
private buildBatches;
|
|
68
|
+
private keysLength;
|
|
69
|
+
private success;
|
|
70
|
+
private status;
|
|
71
|
+
private execute;
|
|
72
|
+
private executeProcess;
|
|
73
|
+
private approve;
|
|
74
|
+
private idempotency;
|
|
75
|
+
private idempotencyKeys;
|
|
76
|
+
private idempotencyAllow;
|
|
77
|
+
private idempotencyStart;
|
|
78
|
+
private idempotencyDone;
|
|
79
|
+
private idempotencyFree;
|
|
80
|
+
private createGroup;
|
|
81
|
+
private select;
|
|
82
|
+
private selectStuck;
|
|
83
|
+
private selectFresh;
|
|
84
|
+
private waitAbortable;
|
|
85
|
+
private heartbeat;
|
|
86
|
+
private normalizeEntries;
|
|
87
|
+
private values;
|
|
88
|
+
private payload;
|
|
89
|
+
private signal;
|
|
90
|
+
private consumer;
|
|
91
|
+
}
|
|
92
|
+
|
|
39
93
|
export { type AddTasksOptions, PowerQueues, type Task };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { PowerRedis,
|
|
2
|
-
|
|
3
|
-
declare const PowerQueues_base: any;
|
|
4
|
-
declare class PowerQueues extends PowerQueues_base {
|
|
5
|
-
abort: AbortController;
|
|
6
|
-
redis: PowerRedis;
|
|
7
|
-
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
8
|
-
onExecute(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
9
|
-
onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
10
|
-
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
11
|
-
runQueue(): Promise<void>;
|
|
12
|
-
consumerLoop(): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import { JsonPrimitiveOrUndefined, PowerRedis, IORedisLike } from 'power-redis';
|
|
14
2
|
|
|
3
|
+
type SavedScript = {
|
|
4
|
+
codeReady?: string;
|
|
5
|
+
codeBody: string;
|
|
6
|
+
};
|
|
15
7
|
type AddTasksOptions = {
|
|
16
8
|
nomkstream?: boolean;
|
|
17
9
|
maxlen?: number;
|
|
@@ -36,4 +28,66 @@ type Task = {
|
|
|
36
28
|
idemKey?: string;
|
|
37
29
|
};
|
|
38
30
|
|
|
31
|
+
declare class PowerQueues extends PowerRedis {
|
|
32
|
+
abort: AbortController;
|
|
33
|
+
redis: IORedisLike;
|
|
34
|
+
readonly strictCheckingConnection: boolean;
|
|
35
|
+
readonly scripts: Record<string, SavedScript>;
|
|
36
|
+
readonly addingBatchTasksCount: number;
|
|
37
|
+
readonly addingBatchKeysLimit: number;
|
|
38
|
+
readonly idemOn: boolean;
|
|
39
|
+
readonly idemKey: string;
|
|
40
|
+
readonly workerExecuteLockTimeoutMs: number;
|
|
41
|
+
readonly workerCacheTaskTimeoutMs: number;
|
|
42
|
+
readonly approveBatchTasksCount: number;
|
|
43
|
+
readonly removeOnExecuted: boolean;
|
|
44
|
+
readonly executeBatchAtOnce: boolean;
|
|
45
|
+
readonly executeJobStatus: boolean;
|
|
46
|
+
readonly executeJobStatusTtlSec: number;
|
|
47
|
+
readonly consumerHost: string;
|
|
48
|
+
readonly stream: string;
|
|
49
|
+
readonly group: string;
|
|
50
|
+
readonly workerBatchTasksCount: number;
|
|
51
|
+
readonly recoveryStuckTasksTimeoutMs: number;
|
|
52
|
+
readonly workerLoopIntervalMs: number;
|
|
53
|
+
readonly workerSelectionTimeoutMs: number;
|
|
54
|
+
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
55
|
+
onExecute(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
56
|
+
onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
57
|
+
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
58
|
+
runQueue(): Promise<void>;
|
|
59
|
+
consumerLoop(): Promise<void>;
|
|
60
|
+
addTasks(queueName: string, data: any[], opts?: AddTasksOptions): Promise<string[]>;
|
|
61
|
+
loadScripts(full?: boolean): Promise<void>;
|
|
62
|
+
private loadScript;
|
|
63
|
+
private saveScript;
|
|
64
|
+
private runScript;
|
|
65
|
+
private xaddBatch;
|
|
66
|
+
private payloadBatch;
|
|
67
|
+
private buildBatches;
|
|
68
|
+
private keysLength;
|
|
69
|
+
private success;
|
|
70
|
+
private status;
|
|
71
|
+
private execute;
|
|
72
|
+
private executeProcess;
|
|
73
|
+
private approve;
|
|
74
|
+
private idempotency;
|
|
75
|
+
private idempotencyKeys;
|
|
76
|
+
private idempotencyAllow;
|
|
77
|
+
private idempotencyStart;
|
|
78
|
+
private idempotencyDone;
|
|
79
|
+
private idempotencyFree;
|
|
80
|
+
private createGroup;
|
|
81
|
+
private select;
|
|
82
|
+
private selectStuck;
|
|
83
|
+
private selectFresh;
|
|
84
|
+
private waitAbortable;
|
|
85
|
+
private heartbeat;
|
|
86
|
+
private normalizeEntries;
|
|
87
|
+
private values;
|
|
88
|
+
private payload;
|
|
89
|
+
private signal;
|
|
90
|
+
private consumer;
|
|
91
|
+
}
|
|
92
|
+
|
|
39
93
|
export { type AddTasksOptions, PowerQueues, type Task };
|