{"id":25996917,"url":"https://github.com/clickup/unique-queue","last_synced_at":"2025-07-29T22:13:28.663Z","repository":{"id":245093040,"uuid":"741399872","full_name":"clickup/unique-queue","owner":"clickup","description":"A simple queue which lowers the chances of scheduling messages with the same key twice","archived":false,"fork":false,"pushed_at":"2025-02-20T16:23:49.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T16:55:25.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/clickup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-10T10:12:20.000Z","updated_at":"2025-02-20T16:06:02.000Z","dependencies_parsed_at":"2024-06-19T19:26:45.645Z","dependency_job_id":"792d8b4a-d4ef-450b-af3a-b1ce971c252a","html_url":"https://github.com/clickup/unique-queue","commit_stats":null,"previous_names":["clickup/unique-queue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clickup/unique-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clickup%2Funique-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clickup%2Funique-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clickup%2Funique-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clickup%2Funique-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clickup","download_url":"https://codeload.github.com/clickup/unique-queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clickup%2Funique-queue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267771568,"owners_count":24142077,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":[],"created_at":"2025-03-05T16:55:38.691Z","updated_at":"2025-07-29T22:13:28.619Z","avatar_url":"https://github.com/clickup.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @time-loop/unique-queue: A simple queue which lowers the chances of scheduling messages with the same key twice\n\nA simple queue which lowers the chances of scheduling messages with the same key\ntwice. It still does NOT guarantee that the message processing function will be\na singleton though: it may happen that it's started at 2 places for the same key\nif this key is scheduled twice after it's been picked up. To guarantee a single\nrunning instance, another library must be used from inside the subscription\ncallback.\n\nThere is also no support for retries of failed jobs recovery. This is because in\npractice a recovery needs to be done at a higher level often times, otherwise\n\"dead letter queue\" would accumulate forever.\n\n## Example\n\n```ts\n// You can also use Redis Cluster here.\nexport const redis = new Redis({\n  host: process.env.REDIS_WORKER_HOST,\n  port: process.env.REDIS_WORKER_PORT,\n  password: process.env.REDIS_WORKER_PASS,\n  keyPrefix: \"queue:\",\n});\n\nconst queue = new Queue\u003c\n  | {\n      type: \"type1\";\n      key: string;\n      some: string;\n    }\n  | {\n      type: \"type2\";\n      key: string;\n      other: string;\n    }\n\u003e({\n  redis,\n  namespace: \"my-queue\",\n});\n\n// ...\n\nawait queue.push({ type: \"type1\", key: \"some\", some: \"some\" }, 10);\n\n// ...\n\nqueue.subscribe(\"type1\", (message) =\u003e console.log(message));\n\n// ...\n\nconst promise = queue.run();\n// ...\npromise.abort();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickup%2Funique-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclickup%2Funique-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickup%2Funique-queue/lists"}