lonnymq 0.0.20 → 0.0.21
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/README.md +1 -67
- package/dist/index.cjs +97 -145
- package/dist/index.d.ts +0 -101
- package/dist/index.js +96 -144
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -138,103 +138,6 @@ export declare class MessageDeferCommand {
|
|
|
138
138
|
});
|
|
139
139
|
execute(databaseClient: DatabaseClient): Promise<MessageDeferCommandResult>;
|
|
140
140
|
}
|
|
141
|
-
export type MessageHeartbeatCommandResultMessageNotFound = {
|
|
142
|
-
resultType: "MESSAGE_NOT_FOUND";
|
|
143
|
-
};
|
|
144
|
-
export type MessageHeartbeatCommandResultStateInvalid = {
|
|
145
|
-
resultType: "MESSAGE_STATE_INVALID";
|
|
146
|
-
};
|
|
147
|
-
export type MessageHeartbeatCommandResultMessageHeartbeated = {
|
|
148
|
-
resultType: "MESSAGE_HEARTBEATED";
|
|
149
|
-
};
|
|
150
|
-
export type MessageHeartbeatCommandResult = MessageHeartbeatCommandResultMessageNotFound | MessageHeartbeatCommandResultStateInvalid | MessageHeartbeatCommandResultMessageHeartbeated;
|
|
151
|
-
export declare class MessageHeartbeatCommand {
|
|
152
|
-
private readonly schema;
|
|
153
|
-
readonly id: string;
|
|
154
|
-
readonly numAttempts: number;
|
|
155
|
-
constructor(params: {
|
|
156
|
-
schema: string;
|
|
157
|
-
id: string;
|
|
158
|
-
numAttempts: number;
|
|
159
|
-
});
|
|
160
|
-
execute(databaseClient: DatabaseClient): Promise<MessageHeartbeatCommandResult>;
|
|
161
|
-
}
|
|
162
|
-
export declare class QueueBatchChannelMessageModule {
|
|
163
|
-
private readonly schema;
|
|
164
|
-
private readonly channelName;
|
|
165
|
-
private readonly registerFn;
|
|
166
|
-
constructor(params: {
|
|
167
|
-
schema: string;
|
|
168
|
-
channelName: string;
|
|
169
|
-
registerFn: BatchedCommandRegisterFn;
|
|
170
|
-
});
|
|
171
|
-
create(params: {
|
|
172
|
-
lockMs: number;
|
|
173
|
-
content: Buffer;
|
|
174
|
-
delayMs?: number;
|
|
175
|
-
}): {
|
|
176
|
-
messageId: string;
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
export declare class QueueBatchChannelPolicyModule {
|
|
180
|
-
private readonly schema;
|
|
181
|
-
private readonly channelName;
|
|
182
|
-
private readonly registerFn;
|
|
183
|
-
constructor(params: {
|
|
184
|
-
schema: string;
|
|
185
|
-
channelName: string;
|
|
186
|
-
registerFn: BatchedCommandRegisterFn;
|
|
187
|
-
});
|
|
188
|
-
set(params: {
|
|
189
|
-
maxConcurrency?: number | null;
|
|
190
|
-
releaseIntervalMs?: number | null;
|
|
191
|
-
}): void;
|
|
192
|
-
clear(): void;
|
|
193
|
-
}
|
|
194
|
-
export declare class QueueBatchChannelModule {
|
|
195
|
-
readonly policy: QueueBatchChannelPolicyModule;
|
|
196
|
-
readonly message: QueueBatchChannelMessageModule;
|
|
197
|
-
constructor(params: {
|
|
198
|
-
schema: string;
|
|
199
|
-
registerFn: BatchedCommandRegisterFn;
|
|
200
|
-
channelName: string;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
export declare class QueueBatchMessageModule {
|
|
204
|
-
private readonly schema;
|
|
205
|
-
private readonly registerFn;
|
|
206
|
-
constructor(params: {
|
|
207
|
-
schema: string;
|
|
208
|
-
registerFn: BatchedCommandRegisterFn;
|
|
209
|
-
});
|
|
210
|
-
create(params: {
|
|
211
|
-
lockMs: number;
|
|
212
|
-
content: Buffer;
|
|
213
|
-
delayMs?: number;
|
|
214
|
-
}): {
|
|
215
|
-
messageId: string;
|
|
216
|
-
channelName: string;
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
export type BatchedCommand = {
|
|
220
|
-
sortKey: string;
|
|
221
|
-
execute: (databaseClient: DatabaseClient) => Promise<void>;
|
|
222
|
-
};
|
|
223
|
-
export type BatchedCommandRegisterFn = (command: BatchedCommand) => void;
|
|
224
|
-
export declare class QueueBatch<T> {
|
|
225
|
-
private readonly commands;
|
|
226
|
-
private readonly schema;
|
|
227
|
-
private readonly adaptor;
|
|
228
|
-
readonly message: QueueBatchMessageModule;
|
|
229
|
-
constructor(params: {
|
|
230
|
-
schema: string;
|
|
231
|
-
adaptor: DatabaseClientAdaptor<T>;
|
|
232
|
-
});
|
|
233
|
-
channel(channelName: string): QueueBatchChannelModule;
|
|
234
|
-
execute(params: {
|
|
235
|
-
databaseClient: T;
|
|
236
|
-
}): Promise<void>;
|
|
237
|
-
}
|
|
238
141
|
export declare class QueueChannelMessageModule<T> {
|
|
239
142
|
private readonly schema;
|
|
240
143
|
private readonly channelName;
|
|
@@ -307,9 +210,6 @@ export declare class QueueMessage<T> {
|
|
|
307
210
|
delete(params: {
|
|
308
211
|
databaseClient: T;
|
|
309
212
|
}): Promise<MessageDeleteCommandResult>;
|
|
310
|
-
heartbeat(params: {
|
|
311
|
-
databaseClient: T;
|
|
312
|
-
}): Promise<MessageHeartbeatCommandResult>;
|
|
313
213
|
}
|
|
314
214
|
export declare class QueueMessageModule<T> {
|
|
315
215
|
private readonly schema;
|
|
@@ -351,7 +251,6 @@ export declare class Queue<T = DatabaseClient> {
|
|
|
351
251
|
databaseClient: T;
|
|
352
252
|
}): Promise<MessageDequeueResult<T>>;
|
|
353
253
|
channel(channelName: string): QueueChannelModule<T>;
|
|
354
|
-
batch(): QueueBatch<T>;
|
|
355
254
|
migrations(params?: {
|
|
356
255
|
eventChannel?: string;
|
|
357
256
|
}): string[];
|