{"id":45905226,"url":"https://github.com/stacksjs/bun-queue","last_synced_at":"2026-02-28T02:17:32.871Z","repository":{"id":289583676,"uuid":"971720914","full_name":"stacksjs/bun-queue","owner":"stacksjs","description":"A modern \u0026 powerful Queue / Messaging system. Optimized for Bun usage. UI coming soon.","archived":false,"fork":false,"pushed_at":"2026-02-21T06:07:42.000Z","size":1074,"stargazers_count":54,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-21T13:26:25.585Z","etag":null,"topics":["bull","bullmq","bun","dashboard","jobs","messaging","queue","typescript"],"latest_commit_sha":null,"homepage":"https://bun-queue.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2025-04-24T00:47:40.000Z","updated_at":"2026-02-21T12:46:18.000Z","dependencies_parsed_at":"2025-05-14T08:20:32.389Z","dependency_job_id":"00ddf59a-8645-45a4-8054-343b6ab657f9","html_url":"https://github.com/stacksjs/bun-queue","commit_stats":null,"previous_names":["stacksjs/bun-bull","stacksjs/bun-bullish","stacksjs/bullish"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stacksjs/bun-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/bun-queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29923070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bull","bullmq","bun","dashboard","jobs","messaging","queue","typescript"],"created_at":"2026-02-28T02:17:32.292Z","updated_at":"2026-02-28T02:17:32.861Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.jpg\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# bun-queue\n\nA Redis-backed job queue built for Bun, inspired by Laravel's Queue system and BullMQ.\n\n## Features\n\n- Fast and efficient Redis-backed queue system\n- Support for delayed jobs, retries, and prioritization\n- Rate limiting capabilities\n- Job event tracking\n- Reliable job processing with concurrency control\n- Typesafe API\n\n## Installation\n\n```bash\nbun add bun-queue\n```\n\n## Basic Usage\n\n```typescript\nimport { Queue } from 'bun-queue'\n\n// Create a queue\nconst emailQueue = new Queue('emails')\n\n// Add a job to the queue\nconst job = await emailQueue.add({\n  to: 'user@example.com',\n  subject: 'Welcome',\n  body: 'Welcome to our platform!'\n})\n\nconsole.log(`Job ${job.id} added to the queue`)\n\n// Process jobs\nemailQueue.process(5, async (job) =\u003e {\n  const { to, subject, body } = job.data\n\n  // Update progress\n  await job.updateProgress(10)\n\n  // Simulate sending email\n  console.log(`Sending email to ${to} with subject: ${subject}`)\n  await new Promise(resolve =\u003e setTimeout(resolve, 1000))\n\n  await job.updateProgress(100)\n\n  return { sent: true, timestamp: Date.now() }\n})\n```\n\n## Job Options\n\n```typescript\n// Add a job with options\nawait queue.add(\n  { task: 'process-pdf', url: 'https://example.com/document.pdf' },\n  {\n    delay: 5000, // delay for 5 seconds\n    attempts: 3, // retry up to 3 times\n    backoff: {\n      type: 'exponential', // 'fixed' or 'exponential'\n      delay: 1000, // milliseconds\n    },\n    priority: 10, // higher number = higher priority\n    removeOnComplete: true, // remove job when completed\n    lifo: false, // process in FIFO order (default)\n    jobId: 'custom-id', // provide custom job ID\n  }\n)\n```\n\n## Delayed Jobs\n\n```typescript\n// Add a job that will be processed after 30 seconds\nawait queue.add(\n  { task: 'send-reminder' },\n  { delay: 30000 }\n)\n```\n\n## Job Management\n\n```typescript\n// Get a job by ID\nconst job = await queue.getJob('job-id')\n\n// Get jobs by status\nconst waitingJobs = await queue.getJobs('waiting')\nconst activeJobs = await queue.getJobs('active')\nconst completedJobs = await queue.getJobs('completed')\nconst failedJobs = await queue.getJobs('failed')\n\n// Get job counts\nconst counts = await queue.getJobCounts()\nconsole.log(counts) // { waiting: 5, active: 2, completed: 10, failed: 1, delayed: 3, paused: 0 }\n\n// Pause a queue\nawait queue.pause()\n\n// Resume a queue\nawait queue.resume()\n\n// Retry a failed job\nconst failedJob = await queue.getJob('failed-job-id')\nawait failedJob.retry()\n\n// Remove a job\nawait job.remove()\n\n// Clear all jobs\nawait queue.empty()\n```\n\n## Rate Limiting\n\n```typescript\nimport { Queue, RateLimiter } from 'bun-queue'\n\nconst queue = new Queue('api-calls')\n\n// Create a rate limiter (100 jobs per minute)\nconst limiter = new RateLimiter(queue, {\n  max: 100,\n  duration: 60000\n})\n\n// Check if rate limited before adding job\nconst { limited, remaining, resetIn } = await limiter.check()\n\nif (!limited) {\n  await queue.add({ url: 'https://api.example.com/endpoint' })\n  console.log(`Job added. ${remaining} requests remaining.`)\n}\nelse {\n  console.log(`Rate limited. Try again in ${resetIn}ms.`)\n}\n```\n\n## Configuration\n\n```typescript\nimport { Queue } from 'bun-queue'\n\n// Configure queue with options\nconst queue = new Queue('tasks', {\n  redis: {\n    url: 'redis://username:password@localhost:6379'\n    // Or provide your own client\n    // client: myRedisClient\n  },\n  prefix: 'myapp', // prefix for Redis keys (default: 'queue')\n  defaultJobOptions: {\n    attempts: 5,\n    backoff: {\n      type: 'exponential',\n      delay: 5000\n    }\n  }\n})\n```\n\n## Environment Variables\n\nThe library reads these environment variables (in order of precedence):\n\n- `REDIS_URL`: Redis connection string\n- Default is `redis://localhost:6379` if not set\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stackjs/bun-queue/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/bun-queue/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n\"Software that is free, but hopes for a postcard.\" We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/bun-queue?style=flat-square\n[npm-version-href]: https://npmjs.com/package/bun-queue\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/bun-queue/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/bun-queue/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/bun-queue/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/bun-queue --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fbun-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fbun-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fbun-queue/lists"}