{"id":18898596,"url":"https://github.com/rack-app/rack-app-worker","last_synced_at":"2025-07-14T02:38:04.217Z","repository":{"id":56890039,"uuid":"55723363","full_name":"rack-app/rack-app-worker","owner":"rack-app","description":"Rack::App Worker extension so you can use scalable async message processing ","archived":false,"fork":false,"pushed_at":"2016-05-18T09:04:22.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T22:06:12.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rack-app.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-07T19:49:11.000Z","updated_at":"2016-09-01T18:17:18.000Z","dependencies_parsed_at":"2022-08-20T15:20:44.403Z","dependency_job_id":null,"html_url":"https://github.com/rack-app/rack-app-worker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rack-app/rack-app-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack-app%2Frack-app-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack-app%2Frack-app-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack-app%2Frack-app-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack-app%2Frack-app-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rack-app","download_url":"https://codeload.github.com/rack-app/rack-app-worker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack-app%2Frack-app-worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265233753,"owners_count":23731825,"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-11-08T08:43:16.139Z","updated_at":"2025-07-14T02:38:04.195Z","avatar_url":"https://github.com/rack-app.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"rack-app-worker\n===============\n\nRack::App::Worker is a Rack::App extension, that allow you to to create scalable asynchronous processing, that takes input in a non-blocking way.\nWith this you can create monstrous work-power for your project with a couple of line. \n\nThe main two goal \n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rack-app-worker'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rack-app-worker\n\n## Usage\n\nOn the webs start the rack application as how you usualy do.\nOn the worker containers or server start with \n  $ rack-app workers start\n\nor if you want run as a service in the background use the -d flag\n  $ rack-app workers start -d \n  \nto stop the daemonized process\n  $ rack-app workers stop \n  \nThe workers use rabbitmq as message broker so you can easily scale horizontally the workers as how your pocket allow this.\nBy default the worker will scale vertically on the server as much as possible if the load requires.\n\nYou can configure the behavior with Linux variables:\n\n```ruby\n\nclass App \u003c Rack::App \n\n  apply_extensions :worker\n\n  worker :payload_saver do\n\n    def persist_payload(payload, hash_with_sym)\n      Database[:some_table].inspert(value: payload)\n    end\n\n  end\n\n  get '/' do\n    workers[:payload_saver].send.persist_payload(payload, {:hello =\u003e params['hello']})\n  end\n\nend\n \n```\n\n\n## ENV Variables\n\n### RABBITMQ_URL\n\nthis is required for connecting to rabbitmq \n\n### WORKER_QOS\n\nthis will manage how much message should be prefetched to a consumer. The default value is 50.\n\n### WORKER_HEARTBEAT_INTERVAL\n\nThis variable manage the time delay between a new consumer creation or remove based on queue size demand\n\n### WORKER_MAX_CONSUMER_NUMBER\n\nThis is used for limiting the maximum vertical of worker process count use\n\n### WORKER_LOG_LEVEL\n\nThis is used to set the log output level for the extensions log messages\n\n### WORKER_STDOUT\n\nIf this configurated, the background process will pipe all stdout io actions to the given output.\n\n### WORKER_STDERR\n\nSame as WORKER_STDOUT but for ERR\n\n### WORKER_NAMESPACE\n\nIf you plan using multiple application on the same container/server than you should use worker namespace to add application specific uniq part to the queues.\n\n### WORKER_CLUSTER\n\nthis is an optional env variable, this defines the workers cluster such as 'backup' or 'secondary'. \nThis is useful when you have two seperated database and you want populate both at once,\nbut you only want one public web api which accept the incoming content.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frack-app%2Frack-app-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frack-app%2Frack-app-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frack-app%2Frack-app-worker/lists"}