
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
moleculer-queues
Advanced tools
Redis-based queue for moleculerjs using Bull.
This package was created with the purpose of solving some problems with the original "moleculer-bull" package, with a new logic this module allows to run jobs manually using "methods" this to avoid "duplication of jobs when the service starts" , it also supports repetitive jobs just like "bull" does, each task is restarted every time the service stops thus avoiding task overload and "double-run"
The main idea of this package is to allow it to support multiple types of "queue" like (bee-queue, cron, etc) in the same way as a task monitor, so far it supports only "bull"
Install my-project with npm
npm install moleculer-queues --save
or
yarn add moleculer-queues
const MoleculerQueues = require('moleculer-queues');
broker.createService({
name: 'service-example',
//Default redis is "localhost"
mixins: [MoleculerQueues('PrefixName', { redis: 'redis://127.0.0.1:6379' })],
methods: {
yourMethod(payload) {
//Some logic...
this.addJobQueue('SendEmail', {
//Your playload data..
});
},
},
queues: [
{
name: 'SendEmail',
async handler(job, done) {
this.logger.info('Sending notification..');
//Some logic...
return done(null, {
message: 'Notification sent!',
});
},
},
],
});
FAQs
Task queue mixin using bull
The npm package moleculer-queues receives a total of 6 weekly downloads. As such, moleculer-queues popularity was classified as not popular.
We found that moleculer-queues demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.