{"id":17092749,"url":"https://github.com/ananthakumaran/exq_batch","last_synced_at":"2025-06-18T22:37:09.289Z","repository":{"id":54464635,"uuid":"318988627","full_name":"ananthakumaran/exq_batch","owner":"ananthakumaran","description":"Batch plugin for Exq library","archived":false,"fork":false,"pushed_at":"2023-09-12T11:01:07.000Z","size":51,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T22:45:29.459Z","etag":null,"topics":["batch","elixir","exq","plugin"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/ananthakumaran.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":"2020-12-06T08:44:48.000Z","updated_at":"2024-12-16T09:19:12.000Z","dependencies_parsed_at":"2024-10-14T14:02:38.246Z","dependency_job_id":"332f8866-804a-44dc-bc97-a62db7b91c61","html_url":"https://github.com/ananthakumaran/exq_batch","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Fexq_batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Fexq_batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Fexq_batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Fexq_batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ananthakumaran","download_url":"https://codeload.github.com/ananthakumaran/exq_batch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643047,"owners_count":21138353,"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":["batch","elixir","exq","plugin"],"created_at":"2024-10-14T14:02:29.997Z","updated_at":"2025-04-12T22:45:57.458Z","avatar_url":"https://github.com/ananthakumaran.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExqBatch\n\n[![Hex.pm](https://img.shields.io/hexpm/v/exq_batch.svg)](https://hex.pm/packages/exq_batch)\n\nExqBatch provides a building block to create complex workflows using\nExq jobs. A batch monitors a group of Exq jobs and creates callback\njob when all the jobs are processed.\n\n## Example\n\n```elixir\n{:ok, batch} = ExqBatch.new(on_complete: [queue: \"default\", class: CompletionWorker, args: [\"complete\"]])\n{:ok, batch, jid} = ExqBatch.add(batch, queue: \"default\", class: Worker, args: [1])\n{:ok, batch, jid} = ExqBatch.add(batch, queue: \"default\", class: Worker, args: [2])\n{:ok, _batch} = ExqBatch.create(batch)\n```\n\nCheckout [documentation](https://hexdocs.pm/exq_batch/ExqBatch.html)\nfor more information.\n\n## Config\n\n```elixir\nconfig :exq,\n  middleware: [\n    Exq.Middleware.Stats,\n    ExqBatch.Middleware,\n    Exq.Middleware.Job,\n    Exq.Middleware.Manager,\n    Exq.Middleware.Logger\n  ]\n```\n\n`ExqBatch.Middleware` middleware **must** be added before the\n`Exq.Middleware.Job` middleware. The middleware is used to track job\nlife cycle.\n\n```elixir\nconfig :exq_batch,\n  # TTL of a batch job. Under normal condition, batch will get deleted\n  # on completion. If a batch failed to complete for any reason, it\n  # will get deleted after TTL seconds\n  ttl_in_seconds: 60 * 60 * 24 * 30,\n  # All the data related to batch will be stored under the prefix in redis\n  prefix: \"exq_batch\",\n  # Optional. If present, batch middleware will be enabled only for\n  # the given queues. If not present, will be enabled for all queues.\n  queues: [\"default\"]\n```\n\n## Caveats\n\n* The completion job will get enqueued only once after all the jobs in\n  a group is either done or dead. A Resurrected job does not belong to\n  the batch and will not lead to creation of completion job.\n\n* All the jobs in a batch **must** be allowed to be complete (either\n  dead or done). Deleting any jobs while they are in retry queue will\n  cause the batch to get stuck and will expire eventually.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananthakumaran%2Fexq_batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananthakumaran%2Fexq_batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananthakumaran%2Fexq_batch/lists"}