queue-jobs-worker 1.0.3 → 1.0.4
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/CHANGELOG.md +63 -58
- package/README.md +16 -61
- package/assets/queue-jobs-worker-demo.mp4 +0 -0
- package/dist/core/client.d.ts +2 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2348,6 +2348,8 @@ var QueueClient = class _QueueClient {
|
|
|
2348
2348
|
queues = /* @__PURE__ */ new Map();
|
|
2349
2349
|
initialised = false;
|
|
2350
2350
|
closed = false;
|
|
2351
|
+
/** True when the adapter was supplied via {@link withAdapter}; init() skips resolveAdapter() in that case. */
|
|
2352
|
+
_customAdapter = false;
|
|
2351
2353
|
constructor(options = {}) {
|
|
2352
2354
|
this.defaults = { ...HARD_DEFAULTS, ...options.defaults };
|
|
2353
2355
|
this.dialect = options.dialect ?? "memory";
|
|
@@ -2383,7 +2385,9 @@ var QueueClient = class _QueueClient {
|
|
|
2383
2385
|
*/
|
|
2384
2386
|
async init() {
|
|
2385
2387
|
if (this.initialised) return;
|
|
2386
|
-
|
|
2388
|
+
if (!this._customAdapter) {
|
|
2389
|
+
this._storage = await this.resolveAdapter();
|
|
2390
|
+
}
|
|
2387
2391
|
await this._storage.initialize();
|
|
2388
2392
|
this.initialised = true;
|
|
2389
2393
|
}
|
|
@@ -2500,6 +2504,7 @@ var QueueClient = class _QueueClient {
|
|
|
2500
2504
|
static withAdapter(adapter, options = {}) {
|
|
2501
2505
|
const client = new _QueueClient(options);
|
|
2502
2506
|
client._storage = adapter;
|
|
2507
|
+
client._customAdapter = true;
|
|
2503
2508
|
return client;
|
|
2504
2509
|
}
|
|
2505
2510
|
};
|