Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@miniflare/queues

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/queues - npm Package Compare versions

Comparing version 2.13.0 to 2.14.0

5

dist/src/index.d.ts

@@ -67,2 +67,3 @@ import { Consumer } from '@miniflare/shared';

getOrCreateQueue(name: string): WorkerQueue;
resetConsumers(): void;
setConsumer(queue: WorkerQueue, consumer: Consumer): void;

@@ -82,2 +83,3 @@ }

export declare class QueuesPlugin extends Plugin<QueuesOptions> implements QueuesOptions {
#private;
queueBindings?: BindingOptions[];

@@ -87,2 +89,3 @@ queueConsumers?: (string | ConsumerOptions)[];

setup(_storageFactory: StorageFactory): Promise<SetupResult>;
beforeReload(): void;
}

@@ -95,3 +98,3 @@

sendBatch(batch: Iterable<MessageSendRequest<Body>>): Promise<void>;
[kSetConsumer](consumer: Consumer): void;
[kSetConsumer](consumer?: Consumer): void;
[kGetConsumer](): Consumer | null;

@@ -98,0 +101,0 @@ [kSetFlushCallback](callback: () => void): void;

32

dist/src/index.js

@@ -56,2 +56,3 @@ var __create = Object.create;

queueConsumers;
#consumers;
constructor(ctx, options) {

@@ -63,5 +64,3 @@ super(ctx);

}
}
async setup(_storageFactory) {
for (const entry of this.queueConsumers ?? []) {
this.#consumers = (this.queueConsumers ?? []).map((entry) => {
let opts;

@@ -75,3 +74,3 @@ if (typeof entry === "string") {

}
const consumer = {
return {
queueName: opts.queueName,

@@ -84,5 +83,5 @@ maxBatchSize: opts.maxBatchSize ?? DEFAULT_BATCH_SIZE,

};
const queue = this.ctx.queueBroker.getOrCreateQueue(opts.queueName);
this.ctx.queueBroker.setConsumer(queue, consumer);
}
});
}
async setup(_storageFactory) {
const bindings = {};

@@ -92,4 +91,11 @@ for (const binding of this.queueBindings ?? []) {

}
return { bindings };
const requiresModuleExports = this.#consumers.length > 0;
return { bindings, requiresModuleExports };
}
beforeReload() {
for (const consumer of this.#consumers) {
const queue = this.ctx.queueBroker.getOrCreateQueue(consumer.queueName);
this.ctx.queueBroker.setConsumer(queue, consumer);
}
}
};

@@ -220,2 +226,8 @@ __decorateClass([

[import_shared2.kSetConsumer](consumer) {
if (consumer === void 0) {
clearTimeout(this.#timeout);
this.#pendingFlush = 0;
this.#consumer = void 0;
return;
}
if (this.#consumer) {

@@ -329,2 +341,6 @@ throw new QueueError("ERR_CONSUMER_ALREADY_SET");

}
resetConsumers() {
for (const queue of this.#queues.values())
queue[import_shared2.kSetConsumer]();
}
setConsumer(queue, consumer) {

@@ -331,0 +347,0 @@ queue[import_shared2.kSetConsumer](consumer);

{
"name": "@miniflare/queues",
"version": "2.13.0",
"version": "2.14.0",
"description": "Workers Queues module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -38,7 +38,7 @@ "keywords": [

"dependencies": {
"@miniflare/shared": "2.13.0"
"@miniflare/shared": "2.14.0"
},
"devDependencies": {
"@miniflare/shared-test": "2.13.0"
"@miniflare/shared-test": "2.14.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc