{"id":22608921,"url":"https://github.com/bitfinexcom/caron","last_synced_at":"2025-04-11T06:13:57.139Z","repository":{"id":57194529,"uuid":"62137001","full_name":"bitfinexcom/caron","owner":"bitfinexcom","description":"Atomic Job enqueuer from Redis lists to popular Job Queues (Sidekiq, Resque, Bull, ...)","archived":false,"fork":false,"pushed_at":"2024-04-03T19:00:21.000Z","size":65,"stargazers_count":10,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T06:13:50.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bitfinex.com","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/bitfinexcom.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-06-28T11:56:40.000Z","updated_at":"2024-10-14T08:11:54.000Z","dependencies_parsed_at":"2024-04-03T20:23:16.064Z","dependency_job_id":"545b4d07-9af6-493a-bd10-e52d6ff8dba4","html_url":"https://github.com/bitfinexcom/caron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fcaron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fcaron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fcaron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fcaron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/caron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351393,"owners_count":21089270,"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-12-08T15:10:06.319Z","updated_at":"2025-04-11T06:13:57.121Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# caron\n\nAtomic Job enqueuer from Redis lists to popular Job Queues (Sidekiq, Bull, ...)\n\n**Caron** pops messages from a redis list and atomically creates a Job for the specified Job Queue.\n\nUses `lua` scripting internally to provide atomicity (http://redis.io/commands/EVAL)\n\n## Support\n\n* [Sidekiq-5.0.4](https://github.com/mperham/sidekiq)\n* [Bull-3.2.0](https://github.com/OptimalBits/bull)\n\n## Install\n```\nnpm install -g caron\n```\n\n## Usage\n\n```\n$ caron --help\n\n  Usage: caron [options]\n\n  Options:\n\n    -h, --help            output usage information\n    -V, --version         output the version number\n    -t, --type \u003cval\u003e      queue type [sidekiq | bull]\n    -l, --list \u003cval\u003e      source redis list (i.e: global_jobs)\n    -r, --redis \u003cval\u003e     redis url (i.e: redis://127.0.0.1:6379)\n    -f, --freq \u003cn\u003e        poll frequency (in milliseconds) - default: 10\n    -b, --batch \u003cn\u003e       max number of jobs created per batch - default: 1000\n    --q_prefix \u003cval\u003e      redis queue prefix (i.e: \"bull\")\n    --def_queue \u003cval\u003e     default dest queue - default: default\n    --def_worker \u003cval\u003e    default Job Queue worker - default: BaseJob\n    --def_attempts \u003cval\u003e  default Bull Job attempts - default: 1\n    --q_lifo              Bull LIFO mode\n\n```\n\n```\ncaron --type sidekiq --list sidekiq_jobs --redis \"redis://127.0.0.1:6379\" --freq 25\n```\n\nDebug mode:\n\n```\nDEBUG=caron:* caron -t bull -l bull_test\n```\n\n### Examples\n\n##### Push from redis-cli\n\n```bash\n// Sidekiq job enqueue\nredis-cli \u003e lpush \"sidekiq_jobs\" \"{\\\"$queue\\\":\\\"critical\\\",\\\"$class\\\":\\\"BackendJob\\\",\\\"foo\\\":\\\"bar\\\",\\\"my\\\":\\\"stuff\\\",\\\"other\\\":\\\"stuff\\\",\\\"other\\\":{\\\"f\\\":5}}\"\n\n// Bull job enqueue\nredis-cli \u003e lpush \"bull_jobs\" \"{\\\"$queue\\\":\\\"critical\\\",\\\"$attempts\\\":4,\\\"$backoff\\\":{\\\"type\\\":\\\"exponential\\\",\\\"delay\\\":5000}, \\\"foo\\\":\\\"bar\\\",\\\"my\\\":\\\"stuff\\\",\\\"other\\\":{\\\"f\\\":5}}\"\n```\n\n##### Push from Node.js\n\n```js\n'use strict'\n\nconst Redis = require('ioredis')\n\nvar redis = new Redis()\n\nredis.lpush('sidekiq_test', JSON.stringify({ foo: 'bar', '$queue': 'critical', '$class': 'MyCriticalJob', other: { a: 1, b: 2 } }))\nredis.lpush('bull_test', JSON.stringify({ foo: 'bar', '$queue': 'priority', '$attempts': 5, '$backoff': { type: 'exponential', delay: 5000 }, other: { a: 1, b: 2 } }))\nredis.lpush('bull_test', JSON.stringify({ foo: 'bar', '$queue': 'lazy', '$attempts': 1, '$delay': 5000, other: { a: 1, b: 2 } }))\n```\n\n##### Push from Ruby\n\n```ruby\nrequire 'redis'\nrequire 'json'\n\nrcli = Redis.new\n\nrcli.lpush('sidekiq_test', JSON.dump({ 'foo' =\u003e 'bar', '$queue' =\u003e 'critical', '$class' =\u003e 'MyCriticalJob', 'other' =\u003e { 'a' =\u003e 1, 'b' =\u003e 2 } }))\nrcli.lpush('bull_test', JSON.dump({ 'foo' =\u003e 'bar', '$queue' =\u003e 'priority', '$attempts' =\u003e 5, '$backoff' =\u003e { 'type' =\u003e exponential', 'delay' =\u003e 5000 }, 'other' =\u003e { 'a' =\u003e 1, 'b' =\u003e 2 } }))\nrcli.lpush('bull_test', JSON.dump({ 'foo' =\u003e 'bar', '$queue' =\u003e 'lazy', '$attempts' =\u003e 1, '$delay' =\u003e 5000, other =\u003e { 'a' =\u003e 1, 'b' =\u003e 2 } }))\nrcli.lpush('bull_test', JSON.dump({ 'foo' =\u003e 'bar', '$queue' =\u003e 'lazy', '$attempts' =\u003e 1, '$delay' =\u003e 5000, other =\u003e { 'a' =\u003e 1, 'b' =\u003e 2 } }))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fcaron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fcaron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fcaron/lists"}