@mqueue/fastq
Version:
MQueue adapter for fastq
2 lines • 876 B
JavaScript
import {promise}from'fastq';var u=class{type="fastq";queue;_consumer;constructor(e=1){this.queue=promise(async(...i)=>this._consumer?.(...i),e);}async healthcheck(){if(this.queue.paused)throw new Error("Fastq Sender unexpectedly disconnected")}async close(){this._consumer=void 0,this.queue.kill();}async consume(e){this._consumer=async i=>{await e({accept:async()=>{},reject:async()=>{},transport:{name:""},message:i});};}};var s=class{constructor(e){this.queue=e;}type="fastq";async healthcheck(){if(this.queue.paused)throw new Error("Fastq Sender unexpectedly disconnected")}async close(){this.queue.pause(),this.queue.kill();}async sendMessage(e){this.queue.push(e);}};var t=class{constructor(){}static Outgoing=s;static Incoming=u};export{u as FastqIncomingQueue,s as FastqOutgoingQueue,t as FastqQueue};//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map