{"action":"created","issue":{"url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/1","labels_url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/1/comments","events_url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/1/events","html_url":"https://github.com/aprescott/sidekiq-bulk/pull/1","id":96203061,"number":1,"title":"Provide a way to limit push sizes and spread jobs over multiple pushes","user":{"login":"aprescott","id":342081,"avatar_url":"https://avatars.githubusercontent.com/u/342081?v=3","gravatar_id":"","url":"https://api.github.com/users/aprescott","html_url":"https://github.com/aprescott","followers_url":"https://api.github.com/users/aprescott/followers","following_url":"https://api.github.com/users/aprescott/following{/other_user}","gists_url":"https://api.github.com/users/aprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/aprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aprescott/subscriptions","organizations_url":"https://api.github.com/users/aprescott/orgs","repos_url":"https://api.github.com/users/aprescott/repos","events_url":"https://api.github.com/users/aprescott/events{/privacy}","received_events_url":"https://api.github.com/users/aprescott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-21T01:12:41Z","updated_at":"2015-07-21T02:09:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aprescott/sidekiq-bulk/pulls/1","html_url":"https://github.com/aprescott/sidekiq-bulk/pull/1","diff_url":"https://github.com/aprescott/sidekiq-bulk/pull/1.diff","patch_url":"https://github.com/aprescott/sidekiq-bulk/pull/1.patch"},"body":"`push_bulk!` is like `push_bulk`, except if the number of items exceeds a threshold, the process of enqueuing is spread across multiple pushes.\r\n\r\nFor example, `push_bulk!([1, 2, 3, 4, 5], limit: 3)` will limit each push to at most 3 items.\r\n\r\n```ruby\r\npush_bulk!([1, 2, 3, 4, 5], limit: 3) { ... }\r\n```\r\n\r\nis thus equivalent to\r\n\r\n```ruby\r\npush_bulk([1, 2, 3]) { ... }\r\npush_bulk([4, 5]) { ... }\r\n```"},"comment":{"url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/comments/123129032","html_url":"https://github.com/aprescott/sidekiq-bulk/pull/1#issuecomment-123129032","issue_url":"https://api.github.com/repos/aprescott/sidekiq-bulk/issues/1","id":123129032,"user":{"login":"aprescott","id":342081,"avatar_url":"https://avatars.githubusercontent.com/u/342081?v=3","gravatar_id":"","url":"https://api.github.com/users/aprescott","html_url":"https://github.com/aprescott","followers_url":"https://api.github.com/users/aprescott/followers","following_url":"https://api.github.com/users/aprescott/following{/other_user}","gists_url":"https://api.github.com/users/aprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/aprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aprescott/subscriptions","organizations_url":"https://api.github.com/users/aprescott/orgs","repos_url":"https://api.github.com/users/aprescott/repos","events_url":"https://api.github.com/users/aprescott/events{/privacy}","received_events_url":"https://api.github.com/users/aprescott/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T02:09:26Z","updated_at":"2015-07-21T02:09:26Z","body":"I'm gonna say that `push_bulk` should be the one that accepts `limit:`, and `push_bulk!` should push all jobs over in one go. If you were to throw several million jobs at `Sidekiq::Client.push_bulk`, you'd likely see some intense latency."}}