{"action":"opened","number":18,"pull_request":{"url":"https://api.github.com/repos/fac/tom_queue/pulls/18","id":47642371,"html_url":"https://github.com/fac/tom_queue/pull/18","diff_url":"https://github.com/fac/tom_queue/pull/18.diff","patch_url":"https://github.com/fac/tom_queue/pull/18.patch","issue_url":"https://api.github.com/repos/fac/tom_queue/issues/18","number":18,"state":"open","locked":false,"title":"[WIP] Refactor deferred set","user":{"login":"jafrog","id":428546,"avatar_url":"https://avatars.githubusercontent.com/u/428546?v=3","gravatar_id":"","url":"https://api.github.com/users/jafrog","html_url":"https://github.com/jafrog","followers_url":"https://api.github.com/users/jafrog/followers","following_url":"https://api.github.com/users/jafrog/following{/other_user}","gists_url":"https://api.github.com/users/jafrog/gists{/gist_id}","starred_url":"https://api.github.com/users/jafrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jafrog/subscriptions","organizations_url":"https://api.github.com/users/jafrog/orgs","repos_url":"https://api.github.com/users/jafrog/repos","events_url":"https://api.github.com/users/jafrog/events{/privacy}","received_events_url":"https://api.github.com/users/jafrog/received_events","type":"User","site_admin":false},"body":"Trying to make code simpler. Removes `DeferredSet` class, moves all of the logic to `Deferred::WorkManager`. Removes custom `SortedArray` and uses [`SortedSet`](http://ruby-doc.org/stdlib-1.9.3/libdoc/set/rdoc/SortedSet.html) instead. Keeps only one mutex around `deferred_set`.\r\n\r\nThe main logic change is that process is now polling it's internal in-memory queue every second rather than maintaining a timer and sleeping until the next message is ready. This is for the sake of doing less. If it proves to be a negative trade-off we should add back.\r\n\r\nWIP! Tests are failing. And I accidentally removed re-queueing logic, should add it back.","created_at":"2015-10-14T10:35:04Z","updated_at":"2015-10-14T10:35:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fac/tom_queue/pulls/18/commits","review_comments_url":"https://api.github.com/repos/fac/tom_queue/pulls/18/comments","review_comment_url":"https://api.github.com/repos/fac/tom_queue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fac/tom_queue/issues/18/comments","statuses_url":"https://api.github.com/repos/fac/tom_queue/statuses/cba050ba765a7aa30f96938bbb85012f9638b2f3","head":{"label":"fac:refactor-deferred-set","ref":"refactor-deferred-set","sha":"cba050ba765a7aa30f96938bbb85012f9638b2f3","user":{"login":"fac","id":302754,"avatar_url":"https://avatars.githubusercontent.com/u/302754?v=3","gravatar_id":"","url":"https://api.github.com/users/fac","html_url":"https://github.com/fac","followers_url":"https://api.github.com/users/fac/followers","following_url":"https://api.github.com/users/fac/following{/other_user}","gists_url":"https://api.github.com/users/fac/gists{/gist_id}","starred_url":"https://api.github.com/users/fac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fac/subscriptions","organizations_url":"https://api.github.com/users/fac/orgs","repos_url":"https://api.github.com/users/fac/repos","events_url":"https://api.github.com/users/fac/events{/privacy}","received_events_url":"https://api.github.com/users/fac/received_events","type":"Organization","site_admin":false},"repo":{"id":11424719,"name":"tom_queue","full_name":"fac/tom_queue","owner":{"login":"fac","id":302754,"avatar_url":"https://avatars.githubusercontent.com/u/302754?v=3","gravatar_id":"","url":"https://api.github.com/users/fac","html_url":"https://github.com/fac","followers_url":"https://api.github.com/users/fac/followers","following_url":"https://api.github.com/users/fac/following{/other_user}","gists_url":"https://api.github.com/users/fac/gists{/gist_id}","starred_url":"https://api.github.com/users/fac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fac/subscriptions","organizations_url":"https://api.github.com/users/fac/orgs","repos_url":"https://api.github.com/users/fac/repos","events_url":"https://api.github.com/users/fac/events{/privacy}","received_events_url":"https://api.github.com/users/fac/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fac/tom_queue","description":"AMQP Queueing backend with hooks into delayed_job_active_record","fork":false,"url":"https://api.github.com/repos/fac/tom_queue","forks_url":"https://api.github.com/repos/fac/tom_queue/forks","keys_url":"https://api.github.com/repos/fac/tom_queue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fac/tom_queue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fac/tom_queue/teams","hooks_url":"https://api.github.com/repos/fac/tom_queue/hooks","issue_events_url":"https://api.github.com/repos/fac/tom_queue/issues/events{/number}","events_url":"https://api.github.com/repos/fac/tom_queue/events","assignees_url":"https://api.github.com/repos/fac/tom_queue/assignees{/user}","branches_url":"https://api.github.com/repos/fac/tom_queue/branches{/branch}","tags_url":"https://api.github.com/repos/fac/tom_queue/tags","blobs_url":"https://api.github.com/repos/fac/tom_queue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fac/tom_queue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fac/tom_queue/git/refs{/sha}","trees_url":"https://api.github.com/repos/fac/tom_queue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fac/tom_queue/statuses/{sha}","languages_url":"https://api.github.com/repos/fac/tom_queue/languages","stargazers_url":"https://api.github.com/repos/fac/tom_queue/stargazers","contributors_url":"https://api.github.com/repos/fac/tom_queue/contributors","subscribers_url":"https://api.github.com/repos/fac/tom_queue/subscribers","subscription_url":"https://api.github.com/repos/fac/tom_queue/subscription","commits_url":"https://api.github.com/repos/fac/tom_queue/commits{/sha}","git_commits_url":"https://api.github.com/repos/fac/tom_queue/git/commits{/sha}","comments_url":"https://api.github.com/repos/fac/tom_queue/comments{/number}","issue_comment_url":"https://api.github.com/repos/fac/tom_queue/issues/comments{/number}","contents_url":"https://api.github.com/repos/fac/tom_queue/contents/{+path}","compare_url":"https://api.github.com/repos/fac/tom_queue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fac/tom_queue/merges","archive_url":"https://api.github.com/repos/fac/tom_queue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fac/tom_queue/downloads","issues_url":"https://api.github.com/repos/fac/tom_queue/issues{/number}","pulls_url":"https://api.github.com/repos/fac/tom_queue/pulls{/number}","milestones_url":"https://api.github.com/repos/fac/tom_queue/milestones{/number}","notifications_url":"https://api.github.com/repos/fac/tom_queue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fac/tom_queue/labels{/name}","releases_url":"https://api.github.com/repos/fac/tom_queue/releases{/id}","created_at":"2013-07-15T14:12:11Z","updated_at":"2015-04-09T11:13:42Z","pushed_at":"2015-10-14T10:12:14Z","git_url":"git://github.com/fac/tom_queue.git","ssh_url":"git@github.com:fac/tom_queue.git","clone_url":"https://github.com/fac/tom_queue.git","svn_url":"https://github.com/fac/tom_queue","homepage":null,"size":789,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"base":{"label":"fac:deferred-jobs-new-bunny","ref":"deferred-jobs-new-bunny","sha":"39864c44b0a99afa677163248fdd73071a147daf","user":{"login":"fac","id":302754,"avatar_url":"https://avatars.githubusercontent.com/u/302754?v=3","gravatar_id":"","url":"https://api.github.com/users/fac","html_url":"https://github.com/fac","followers_url":"https://api.github.com/users/fac/followers","following_url":"https://api.github.com/users/fac/following{/other_user}","gists_url":"https://api.github.com/users/fac/gists{/gist_id}","starred_url":"https://api.github.com/users/fac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fac/subscriptions","organizations_url":"https://api.github.com/users/fac/orgs","repos_url":"https://api.github.com/users/fac/repos","events_url":"https://api.github.com/users/fac/events{/privacy}","received_events_url":"https://api.github.com/users/fac/received_events","type":"Organization","site_admin":false},"repo":{"id":11424719,"name":"tom_queue","full_name":"fac/tom_queue","owner":{"login":"fac","id":302754,"avatar_url":"https://avatars.githubusercontent.com/u/302754?v=3","gravatar_id":"","url":"https://api.github.com/users/fac","html_url":"https://github.com/fac","followers_url":"https://api.github.com/users/fac/followers","following_url":"https://api.github.com/users/fac/following{/other_user}","gists_url":"https://api.github.com/users/fac/gists{/gist_id}","starred_url":"https://api.github.com/users/fac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fac/subscriptions","organizations_url":"https://api.github.com/users/fac/orgs","repos_url":"https://api.github.com/users/fac/repos","events_url":"https://api.github.com/users/fac/events{/privacy}","received_events_url":"https://api.github.com/users/fac/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fac/tom_queue","description":"AMQP Queueing backend with hooks into delayed_job_active_record","fork":false,"url":"https://api.github.com/repos/fac/tom_queue","forks_url":"https://api.github.com/repos/fac/tom_queue/forks","keys_url":"https://api.github.com/repos/fac/tom_queue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fac/tom_queue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fac/tom_queue/teams","hooks_url":"https://api.github.com/repos/fac/tom_queue/hooks","issue_events_url":"https://api.github.com/repos/fac/tom_queue/issues/events{/number}","events_url":"https://api.github.com/repos/fac/tom_queue/events","assignees_url":"https://api.github.com/repos/fac/tom_queue/assignees{/user}","branches_url":"https://api.github.com/repos/fac/tom_queue/branches{/branch}","tags_url":"https://api.github.com/repos/fac/tom_queue/tags","blobs_url":"https://api.github.com/repos/fac/tom_queue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fac/tom_queue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fac/tom_queue/git/refs{/sha}","trees_url":"https://api.github.com/repos/fac/tom_queue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fac/tom_queue/statuses/{sha}","languages_url":"https://api.github.com/repos/fac/tom_queue/languages","stargazers_url":"https://api.github.com/repos/fac/tom_queue/stargazers","contributors_url":"https://api.github.com/repos/fac/tom_queue/contributors","subscribers_url":"https://api.github.com/repos/fac/tom_queue/subscribers","subscription_url":"https://api.github.com/repos/fac/tom_queue/subscription","commits_url":"https://api.github.com/repos/fac/tom_queue/commits{/sha}","git_commits_url":"https://api.github.com/repos/fac/tom_queue/git/commits{/sha}","comments_url":"https://api.github.com/repos/fac/tom_queue/comments{/number}","issue_comment_url":"https://api.github.com/repos/fac/tom_queue/issues/comments{/number}","contents_url":"https://api.github.com/repos/fac/tom_queue/contents/{+path}","compare_url":"https://api.github.com/repos/fac/tom_queue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fac/tom_queue/merges","archive_url":"https://api.github.com/repos/fac/tom_queue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fac/tom_queue/downloads","issues_url":"https://api.github.com/repos/fac/tom_queue/issues{/number}","pulls_url":"https://api.github.com/repos/fac/tom_queue/pulls{/number}","milestones_url":"https://api.github.com/repos/fac/tom_queue/milestones{/number}","notifications_url":"https://api.github.com/repos/fac/tom_queue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fac/tom_queue/labels{/name}","releases_url":"https://api.github.com/repos/fac/tom_queue/releases{/id}","created_at":"2013-07-15T14:12:11Z","updated_at":"2015-04-09T11:13:42Z","pushed_at":"2015-10-14T10:12:14Z","git_url":"git://github.com/fac/tom_queue.git","ssh_url":"git@github.com:fac/tom_queue.git","clone_url":"https://github.com/fac/tom_queue.git","svn_url":"https://github.com/fac/tom_queue","homepage":null,"size":789,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fac/tom_queue/pulls/18"},"html":{"href":"https://github.com/fac/tom_queue/pull/18"},"issue":{"href":"https://api.github.com/repos/fac/tom_queue/issues/18"},"comments":{"href":"https://api.github.com/repos/fac/tom_queue/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/fac/tom_queue/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/fac/tom_queue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fac/tom_queue/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/fac/tom_queue/statuses/cba050ba765a7aa30f96938bbb85012f9638b2f3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":7,"additions":147,"deletions":357,"changed_files":6}}