|
1 | 1 | export type QueryDef = unknown;
|
2 | 2 | // Primary key of Queue item
|
3 | 3 | export type QueueId = string | number | bigint;
|
4 |
| -// This was used as lock for Redis, deprecated. |
5 |
| -export type ProcessingId = string | number; |
| 4 | +// This was used as a lock for Redis, deprecated. |
| 5 | +export type ProcessingId = string | number | bigint; |
6 | 6 | export type QueryKey = (string | [string, any[]]) & {
|
7 | 7 | persistent?: true,
|
8 | 8 | };
|
@@ -64,25 +64,25 @@ export interface QueueDriverConnectionInterface {
|
64 | 64 | * @param keyScore Redis specific thing
|
65 | 65 | * @param queryKey
|
66 | 66 | * @param orphanedTime
|
67 |
| - * @param queryHandler Our queue allow to use different handlers. For example query, cvsQuery, etc. |
| 67 | + * @param queryHandler Our queue allows using different handlers. For example, query, cvsQuery, etc. |
68 | 68 | * @param query
|
69 | 69 | * @param priority
|
70 | 70 | * @param options
|
71 | 71 | */
|
72 | 72 | addToQueue(keyScore: number, queryKey: QueryKey, orphanedTime: number, queryHandler: string, query: AddToQueueQuery, priority: number, options: AddToQueueOptions): Promise<AddToQueueResponse>;
|
73 |
| - // Return query keys which was sorted by priority and time |
| 73 | + // Return query keys that were sorted by priority and time |
74 | 74 | getToProcessQueries(): Promise<QueryKeysTuple[]>;
|
75 | 75 | getActiveQueries(): Promise<QueryKeysTuple[]>;
|
76 | 76 | getQueryDef(hash: QueryKeyHash, queueId: QueueId | null): Promise<QueryDef | null>;
|
77 |
| - // Queries which was added to queue, but was not processed and not needed |
| 77 | + // Queries that were added to queue, but was not processed and not needed |
78 | 78 | getOrphanedQueries(): Promise<QueryKeysTuple[]>;
|
79 |
| - // Queries which was not completed with old heartbeat |
| 79 | + // Queries that were not completed with old heartbeat |
80 | 80 | getStalledQueries(): Promise<QueryKeysTuple[]>;
|
81 | 81 | getQueryStageState(onlyKeys: boolean): Promise<QueryStageStateResponse>;
|
82 | 82 | updateHeartBeat(hash: QueryKeyHash, queueId: QueueId | null): Promise<void>;
|
83 | 83 | getNextProcessingId(): Promise<ProcessingId>;
|
84 | 84 | // Trying to acquire a lock for processing a queue item, this method can return null when
|
85 |
| - // multiple nodes tries to process the same query |
| 85 | + // multiple nodes try to process the same query |
86 | 86 | retrieveForProcessing(hash: QueryKeyHash, processingId: ProcessingId): Promise<RetrieveForProcessingResponse>;
|
87 | 87 | freeProcessingLock(hash: QueryKeyHash, processingId: ProcessingId, activated: unknown): Promise<void>;
|
88 | 88 | optimisticQueryUpdate(hash: QueryKeyHash, toUpdate: unknown, processingId: ProcessingId, queueId: QueueId | null): Promise<boolean>;
|
|
0 commit comments