{"id":15602921,"url":"https://github.com/ccocchi/sidekiq-paquet","last_synced_at":"2026-02-19T18:32:47.634Z","repository":{"id":56895541,"uuid":"47996231","full_name":"ccocchi/sidekiq-paquet","owner":"ccocchi","description":"Moves your Sidekiq jobs into paquets.","archived":false,"fork":false,"pushed_at":"2024-07-23T15:39:50.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T06:09:31.513Z","etag":null,"topics":["bulk","sidekiq"],"latest_commit_sha":null,"homepage":"","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/ccocchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-12-14T19:23:00.000Z","updated_at":"2021-06-28T09:09:42.000Z","dependencies_parsed_at":"2024-11-13T16:41:08.165Z","dependency_job_id":"b8416396-6b08-41e6-971e-9cf8fd181b0e","html_url":"https://github.com/ccocchi/sidekiq-paquet","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"2d53c457008fbf96e75f5d7e501399d1087adee2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ccocchi/sidekiq-paquet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Fsidekiq-paquet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Fsidekiq-paquet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Fsidekiq-paquet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Fsidekiq-paquet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccocchi","download_url":"https://codeload.github.com/ccocchi/sidekiq-paquet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Fsidekiq-paquet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29627112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bulk","sidekiq"],"created_at":"2024-10-03T03:00:54.433Z","updated_at":"2026-02-19T18:32:47.619Z","avatar_url":"https://github.com/ccocchi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sidekiq::Paquet\n\nInstead of enqueueing and processing jobs one at a time, enqueue them one by one and process them in bulk.\nUseful for grouping background API calls or intensive database inserts coming from multiple sources.\n\n## Installation\n\n```ruby\ngem install 'sidekiq-paquet'\n```\n\nsidekiq-paquet requires Sidekiq 4+.\n\n## Usage\n\nAdd `bundled: true` option to your worker's `sidekiq_options` to have jobs processed in bulk. The size of the bundle can be configured per worker. If not specified, the `Sidekiq::Paquet.options[:default_bundle_size]` is used.\n\n```ruby\nclass ElasticIndexerWorker\n  include Sidekiq::Worker\n\n  sidekiq_options bundled: true, bundle_size: 100\n\n  def perform(*values)\n    # Perform work with the array of values\n  end\nend\n```\n\nInstead of being processed by Sidekiq right away, jobs will be stored into a separate queue and periodically, a separate thread will pick up this internal queue, slice `bundle_size` elements into an array and enqueue a regular Sidekiq job with that bundle as argument.\nThus, your worker will only be invoked with an array of values, never with single values themselves.\n\nFor example, if you call `perform_async` twice on the previous worker\n\n```ruby\nElasticIndexerWorker.perform_async({ delete: { _index: 'users', _id: 1, _type: 'user' } })\nElasticIndexerWorker.perform_async({ delete: { _index: 'users', _id: 2, _type: 'user' } })\n```\n\nthe worker instance will receive these values as a single argument\n\n```ruby\n[\n  [{ delete: { _index: 'users', _id: 1, _type: 'user' } }],\n  [{ delete: { _index: 'users', _id: 2, _type: 'user' } }]\n]\n```\n\nEvery time flushing happens, `sidekiq-paquet` will try to process all your workers marked as bundled. If you want to limit the time between two flushing in a worker, you can pass the `minimum_execution_interval` option to sidekiq options.\n\n## Configuration\n\nYou can change global configuration by modifying the `Sidekiq::Paquet.options` hash.\n\n```\n  Sidekiq::Paquet.options[:default_bundle_size] = 500 # Default is 100\n  Sidekiq::Paquet.options[:average_flush_interval] = 30 # Default is 15\n```\n\nThe `average_flush_interval` represent the average time elapsed between two polling of values. This scales with the number of sidekiq processes you're running. So if you have 5 sidekiq processes, and set the `average_flush_interval` to 15, each process will check for new bundled jobs every 75 seconds -- so that in average, the bundles queue will be checked every 15 seconds.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ccocchi/sidekiq-paquet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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%2Fccocchi%2Fsidekiq-paquet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccocchi%2Fsidekiq-paquet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccocchi%2Fsidekiq-paquet/lists"}