{"id":22100392,"url":"https://github.com/homuchen/simple-work-queues","last_synced_at":"2025-07-01T12:03:42.343Z","repository":{"id":57148440,"uuid":"125710137","full_name":"HoMuChen/simple-work-queues","owner":"HoMuChen","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-05T14:44:07.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T12:02:38.966Z","etag":null,"topics":["delay-queue","delayed-jobs","delayed-tasks","message-queue","rabbitmq-client"],"latest_commit_sha":null,"homepage":null,"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/HoMuChen.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":"2018-03-18T09:34:27.000Z","updated_at":"2018-06-05T14:44:08.000Z","dependencies_parsed_at":"2022-08-31T23:50:19.099Z","dependency_job_id":null,"html_url":"https://github.com/HoMuChen/simple-work-queues","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HoMuChen/simple-work-queues","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fsimple-work-queues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fsimple-work-queues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fsimple-work-queues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fsimple-work-queues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoMuChen","download_url":"https://codeload.github.com/HoMuChen/simple-work-queues/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fsimple-work-queues/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262959563,"owners_count":23391057,"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":["delay-queue","delayed-jobs","delayed-tasks","message-queue","rabbitmq-client"],"created_at":"2024-12-01T05:13:56.500Z","updated_at":"2025-07-01T12:03:42.309Z","avatar_url":"https://github.com/HoMuChen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-work-queues\n\nDelay your functions to queues backed by RabbitMQ\n\n## Install\n\n    $ npm install simple-work-queues\n\n## Usage\n\nFor example,\n\nworker.js\n```javascript\nconst { Worker } = require('simple-work-queues');\nconst { fn1, fn2 } = require('./tasks'); // import functions from whereever you want\n\nconst config = {\n  brokerURL: 'your-rabbitmq-broker-url',\n  noAck: false, //boolean\n  prefetch: 1, //concurrency for every worker, default 1, only useful when noAck is false\n  routes: {\n    queue1: fn1,\n    queue2: fn2,\n  }\n}\n\nconst worker = Worker(config);\n\nworker.listen('queue1');\nworker.listen('queue2', (err, data) =\u003e {console.log(data)}); //add callback function(optional), data is what returned by your function\n\n```\n\ndispatcher.js\n```javascript\nconst { Producer } = require('simple-work-queues');\nconst { fn1, fn2 } = require('./tasks'); // import functions from whereever you want\n\nconst producer = Producer(config); // config is the same with the one in worker.js\n\nproducer.delay(fn1)(); //wrap your function and call it whenever u want\nproducer.delay(fn2)();\n\n```\n\n## Author\n\nHoMuchen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomuchen%2Fsimple-work-queues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomuchen%2Fsimple-work-queues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomuchen%2Fsimple-work-queues/lists"}