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