{"id":13747317,"url":"https://github.com/breamware/sidekiq-batch","last_synced_at":"2025-05-09T08:32:17.531Z","repository":{"id":38865399,"uuid":"66276742","full_name":"breamware/sidekiq-batch","owner":"breamware","description":"Sidekiq Batch Jobs Implementation","archived":false,"fork":false,"pushed_at":"2024-08-02T06:40:37.000Z","size":124,"stargazers_count":357,"open_issues_count":0,"forks_count":95,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-19T07:05:16.611Z","etag":null,"topics":["batch","sidekiq","sidekiq-batch"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/breamware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"breamware","open_collective":"sidekiq-batch"}},"created_at":"2016-08-22T13:50:37.000Z","updated_at":"2024-09-24T01:28:07.000Z","dependencies_parsed_at":"2024-01-12T08:48:28.747Z","dependency_job_id":"84cff6aa-c42b-48d1-99dc-2c6ae6ce656b","html_url":"https://github.com/breamware/sidekiq-batch","commit_stats":{"total_commits":127,"total_committers":21,"mean_commits":"6.0476190476190474","dds":0.5590551181102362,"last_synced_commit":"da3f35441cad206b9fc6bc9f231cb252f3b31c61"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breamware%2Fsidekiq-batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breamware%2Fsidekiq-batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breamware%2Fsidekiq-batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breamware%2Fsidekiq-batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breamware","download_url":"https://codeload.github.com/breamware/sidekiq-batch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224842671,"owners_count":17379010,"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","sidekiq","sidekiq-batch"],"created_at":"2024-08-03T06:01:24.930Z","updated_at":"2025-05-09T08:32:17.515Z","avatar_url":"https://github.com/breamware.png","language":"Ruby","funding_links":["https://github.com/sponsors/breamware","https://opencollective.com/sidekiq-batch"],"categories":["Ruby"],"sub_categories":[],"readme":"[gem]: https://rubygems.org/gems/sidekiq-batch\n[ci]: https://github.com/breamware/sidekiq-batch/actions/workflows/ci.yml\n\n# Sidekiq::Batch\n\n[![Join the chat at https://gitter.im/breamware/sidekiq-batch](https://badges.gitter.im/breamware/sidekiq-batch.svg)](https://gitter.im/breamware/sidekiq-batch?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Gem Version](https://badge.fury.io/rb/sidekiq-batch.svg)][gem]\n[![CI](https://github.com/breamware/sidekiq-batch/actions/workflows/ci.yml/badge.svg?branch=master)][ci]\n\nSimple Sidekiq Batch Job implementation.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sidekiq-batch'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install sidekiq-batch\n\n## Usage\n\nSidekiq Batch is MOSTLY a drop-in replacement for the API from Sidekiq PRO. See https://github.com/mperham/sidekiq/wiki/Batches for usage.\n\n## Caveats/Gotchas\n\nConsider the following workflow:\n\n  * Batch Z created\n  * Worker A queued in batch Z\n  * Worker A starts Worker B in batch Z\n  * Worker B completes *before* worker A does\n  * Worker A completes\n\nIn the standard configuration, the `on(:success)` and `on(:complete)` callbacks will be triggered when Worker B completes.\nThis configuration is the default, simply for legacy reasons. This gem adds the following option to the sidekiq.yml options:\n\n```yaml\n:batch_push_interval: 0\n```\n\nWhen this value is *absent* (aka legacy), Worker A will only push the increment of batch jobs (aka Worker B) *when it completes*\n\nWhen this value is set to `0`, Worker A will increment the count as soon as `WorkerB.perform_async` is called\n\nWhen this value is a positive number, Worker A will wait a maximum of value-seconds before pushing the increment to redis, or until it's done, whichever comes first.\n\nThis comes into play if Worker A is queueing thousands of WorkerB jobs, or has some other reason for WorkerB to complete beforehand.\n\nIf you are queueing many WorkerB jobs, it is recommended to set this value to something like `3` to avoid thousands of calls to redis, and call WorkerB like so:\n```ruby\nWorkerB.perform_in(4.seconds, some, args)\n```\nthis will ensure that the batch callback does not get triggered until WorkerA *and* the last WorkerB job complete.\n\nIf WorkerA is just slow for whatever reason, setting to `0` will update the batch status immediately so that the callbacks don't fire.\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/breamware/sidekiq-batch.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreamware%2Fsidekiq-batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreamware%2Fsidekiq-batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreamware%2Fsidekiq-batch/lists"}