{"id":18064778,"url":"https://github.com/juandl/moleculer-queues","last_synced_at":"2025-04-11T18:11:10.984Z","repository":{"id":57687540,"uuid":"470122196","full_name":"juandl/moleculer-queues","owner":"juandl","description":"Redis-based queue for moleculer using Bull","archived":false,"fork":false,"pushed_at":"2024-05-19T18:27:51.000Z","size":157,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T14:05:55.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juandl.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-15T11:07:24.000Z","updated_at":"2024-05-19T18:27:53.000Z","dependencies_parsed_at":"2023-02-19T12:15:29.228Z","dependency_job_id":null,"html_url":"https://github.com/juandl/moleculer-queues","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juandl%2Fmoleculer-queues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juandl%2Fmoleculer-queues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juandl%2Fmoleculer-queues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juandl%2Fmoleculer-queues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juandl","download_url":"https://codeload.github.com/juandl/moleculer-queues/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456364,"owners_count":21106603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T06:07:34.295Z","updated_at":"2025-04-11T18:11:10.963Z","avatar_url":"https://github.com/juandl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Moleculer logo](http://moleculer.services/images/banner.png)\n\n# moleculer-queues [![NPM version](https://img.shields.io/npm/v/moleculer-queues.svg)](https://www.npmjs.com/package/moleculer-queues)\n\nRedis-based queue for moleculerjs using [Bull](https://github.com/OptimalBits/bull).\n\nThis 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\"\n\nThe 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\"\n\n## Installation\n\nInstall my-project with npm\n\n```bash\nnpm install moleculer-queues --save\n```\n\nor\n\n```bash\nyarn add moleculer-queues\n```\n\n## Usage/Examples\n\n```javascript\nconst MoleculerQueues = require('moleculer-queues');\n\nbroker.createService({\n  name: 'service-example',\n  //Default redis is \"localhost\"\n  mixins: [MoleculerQueues('PrefixName', { redis: 'redis://127.0.0.1:6379' })],\n  methods: {\n    yourMethod(payload) {\n      //Some logic...\n\n      this.addJobQueue('SendEmail', {\n        //Your playload data..\n      });\n    },\n  },\n  queues: [\n    {\n      name: 'SendEmail',\n      async handler(job, done) {\n        this.logger.info('Sending notification..');\n\n        //Some logic...\n\n        return done(null, {\n          message: 'Notification sent!',\n        });\n      },\n    },\n  ],\n});\n```\n\n## To-do\n\n- [ ] Unit Testing\n- [ ] Real Example\n- [ ] Add support for multiples \"queues packages\"\n- [ ] Allow to add custom \"queue processor\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuandl%2Fmoleculer-queues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuandl%2Fmoleculer-queues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuandl%2Fmoleculer-queues/lists"}