Skip to content

Instantly share code, notes, and snippets.

View weyoss's full-sized avatar
🌍

weyoss

🌍
  • Planet Earth
View GitHub Profile
@intech
intech / queue.js
Created May 2, 2021 15:33
Moleculer Middleware redis-smq
const { callbackify } = require("util");
const { GracefulStopTimeoutError } = require("moleculer").Errors;
const { Message, Producer, Consumer } = require("redis-smq");
const events = require("redis-smq/src/events");
module.exports = function QueueMiddleware() {
const producers = new Map();
const consumers = new Map();
function gracefulShutdown(broker, items) {