{"action":"opened","number":54,"pull_request":{"url":"https://api.github.com/repos/tpitale/mail_room/pulls/54","id":50306315,"html_url":"https://github.com/tpitale/mail_room/pull/54","diff_url":"https://github.com/tpitale/mail_room/pull/54.diff","patch_url":"https://github.com/tpitale/mail_room/pull/54.patch","issue_url":"https://api.github.com/repos/tpitale/mail_room/issues/54","number":54,"state":"open","locked":false,"title":"Postgresql-based advisory lock arbitration method","user":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"body":"* (Attempt at) matching arbitration functionality from redis\r\n* Rather than a 10 minute expiry, as in redis, locks are held for the lifetime of the connection (session), essentially the life of the process. This should prevent the vast majority of duplicate deliveries except (theoretically) when one mailbox process dies _very_ shortly after sending some deliveries. If that happens, another mailbox process _could_ be timed in such a way as to pick up some message UIDs that have already been delivered.\r\n* pg_try_advisory_lock will return 't' or 'f', as long as the database is shared (a shared mutex, just like we do with redis)\r\n\r\nDocs and (maybe) benchmarks to come.\r\n\r\n/cc @DouweM in case you're interested","created_at":"2015-11-10T20:27:10Z","updated_at":"2015-11-10T20:27:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"169f8eec32124dbf4c2d0c7be6b8856992f57e78","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tpitale/mail_room/pulls/54/commits","review_comments_url":"https://api.github.com/repos/tpitale/mail_room/pulls/54/comments","review_comment_url":"https://api.github.com/repos/tpitale/mail_room/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tpitale/mail_room/issues/54/comments","statuses_url":"https://api.github.com/repos/tpitale/mail_room/statuses/3c4ecbd3e9283be18448f40643583fc7ef2764a5","head":{"label":"tpitale:pg-arbitration","ref":"pg-arbitration","sha":"3c4ecbd3e9283be18448f40643583fc7ef2764a5","user":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"repo":{"id":7790606,"name":"mail_room","full_name":"tpitale/mail_room","owner":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tpitale/mail_room","description":"Forward mail from gmail IMAP to a callback URL or job worker, simply.","fork":false,"url":"https://api.github.com/repos/tpitale/mail_room","forks_url":"https://api.github.com/repos/tpitale/mail_room/forks","keys_url":"https://api.github.com/repos/tpitale/mail_room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tpitale/mail_room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tpitale/mail_room/teams","hooks_url":"https://api.github.com/repos/tpitale/mail_room/hooks","issue_events_url":"https://api.github.com/repos/tpitale/mail_room/issues/events{/number}","events_url":"https://api.github.com/repos/tpitale/mail_room/events","assignees_url":"https://api.github.com/repos/tpitale/mail_room/assignees{/user}","branches_url":"https://api.github.com/repos/tpitale/mail_room/branches{/branch}","tags_url":"https://api.github.com/repos/tpitale/mail_room/tags","blobs_url":"https://api.github.com/repos/tpitale/mail_room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tpitale/mail_room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tpitale/mail_room/git/refs{/sha}","trees_url":"https://api.github.com/repos/tpitale/mail_room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tpitale/mail_room/statuses/{sha}","languages_url":"https://api.github.com/repos/tpitale/mail_room/languages","stargazers_url":"https://api.github.com/repos/tpitale/mail_room/stargazers","contributors_url":"https://api.github.com/repos/tpitale/mail_room/contributors","subscribers_url":"https://api.github.com/repos/tpitale/mail_room/subscribers","subscription_url":"https://api.github.com/repos/tpitale/mail_room/subscription","commits_url":"https://api.github.com/repos/tpitale/mail_room/commits{/sha}","git_commits_url":"https://api.github.com/repos/tpitale/mail_room/git/commits{/sha}","comments_url":"https://api.github.com/repos/tpitale/mail_room/comments{/number}","issue_comment_url":"https://api.github.com/repos/tpitale/mail_room/issues/comments{/number}","contents_url":"https://api.github.com/repos/tpitale/mail_room/contents/{+path}","compare_url":"https://api.github.com/repos/tpitale/mail_room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tpitale/mail_room/merges","archive_url":"https://api.github.com/repos/tpitale/mail_room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tpitale/mail_room/downloads","issues_url":"https://api.github.com/repos/tpitale/mail_room/issues{/number}","pulls_url":"https://api.github.com/repos/tpitale/mail_room/pulls{/number}","milestones_url":"https://api.github.com/repos/tpitale/mail_room/milestones{/number}","notifications_url":"https://api.github.com/repos/tpitale/mail_room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tpitale/mail_room/labels{/name}","releases_url":"https://api.github.com/repos/tpitale/mail_room/releases{/id}","created_at":"2013-01-24T04:38:48Z","updated_at":"2015-11-09T20:58:12Z","pushed_at":"2015-11-10T20:27:11Z","git_url":"git://github.com/tpitale/mail_room.git","ssh_url":"git@github.com:tpitale/mail_room.git","clone_url":"https://github.com/tpitale/mail_room.git","svn_url":"https://github.com/tpitale/mail_room","homepage":"","size":623,"stargazers_count":100,"watchers_count":100,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":8,"forks":16,"open_issues":8,"watchers":100,"default_branch":"master"}},"base":{"label":"tpitale:master","ref":"master","sha":"c6a566d115047690a7e1ab35778d765f244232fe","user":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"repo":{"id":7790606,"name":"mail_room","full_name":"tpitale/mail_room","owner":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tpitale/mail_room","description":"Forward mail from gmail IMAP to a callback URL or job worker, simply.","fork":false,"url":"https://api.github.com/repos/tpitale/mail_room","forks_url":"https://api.github.com/repos/tpitale/mail_room/forks","keys_url":"https://api.github.com/repos/tpitale/mail_room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tpitale/mail_room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tpitale/mail_room/teams","hooks_url":"https://api.github.com/repos/tpitale/mail_room/hooks","issue_events_url":"https://api.github.com/repos/tpitale/mail_room/issues/events{/number}","events_url":"https://api.github.com/repos/tpitale/mail_room/events","assignees_url":"https://api.github.com/repos/tpitale/mail_room/assignees{/user}","branches_url":"https://api.github.com/repos/tpitale/mail_room/branches{/branch}","tags_url":"https://api.github.com/repos/tpitale/mail_room/tags","blobs_url":"https://api.github.com/repos/tpitale/mail_room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tpitale/mail_room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tpitale/mail_room/git/refs{/sha}","trees_url":"https://api.github.com/repos/tpitale/mail_room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tpitale/mail_room/statuses/{sha}","languages_url":"https://api.github.com/repos/tpitale/mail_room/languages","stargazers_url":"https://api.github.com/repos/tpitale/mail_room/stargazers","contributors_url":"https://api.github.com/repos/tpitale/mail_room/contributors","subscribers_url":"https://api.github.com/repos/tpitale/mail_room/subscribers","subscription_url":"https://api.github.com/repos/tpitale/mail_room/subscription","commits_url":"https://api.github.com/repos/tpitale/mail_room/commits{/sha}","git_commits_url":"https://api.github.com/repos/tpitale/mail_room/git/commits{/sha}","comments_url":"https://api.github.com/repos/tpitale/mail_room/comments{/number}","issue_comment_url":"https://api.github.com/repos/tpitale/mail_room/issues/comments{/number}","contents_url":"https://api.github.com/repos/tpitale/mail_room/contents/{+path}","compare_url":"https://api.github.com/repos/tpitale/mail_room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tpitale/mail_room/merges","archive_url":"https://api.github.com/repos/tpitale/mail_room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tpitale/mail_room/downloads","issues_url":"https://api.github.com/repos/tpitale/mail_room/issues{/number}","pulls_url":"https://api.github.com/repos/tpitale/mail_room/pulls{/number}","milestones_url":"https://api.github.com/repos/tpitale/mail_room/milestones{/number}","notifications_url":"https://api.github.com/repos/tpitale/mail_room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tpitale/mail_room/labels{/name}","releases_url":"https://api.github.com/repos/tpitale/mail_room/releases{/id}","created_at":"2013-01-24T04:38:48Z","updated_at":"2015-11-09T20:58:12Z","pushed_at":"2015-11-10T20:27:11Z","git_url":"git://github.com/tpitale/mail_room.git","ssh_url":"git@github.com:tpitale/mail_room.git","clone_url":"https://github.com/tpitale/mail_room.git","svn_url":"https://github.com/tpitale/mail_room","homepage":"","size":623,"stargazers_count":100,"watchers_count":100,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":8,"forks":16,"open_issues":8,"watchers":100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tpitale/mail_room/pulls/54"},"html":{"href":"https://github.com/tpitale/mail_room/pull/54"},"issue":{"href":"https://api.github.com/repos/tpitale/mail_room/issues/54"},"comments":{"href":"https://api.github.com/repos/tpitale/mail_room/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/tpitale/mail_room/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/tpitale/mail_room/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tpitale/mail_room/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/tpitale/mail_room/statuses/3c4ecbd3e9283be18448f40643583fc7ef2764a5"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":114,"deletions":2,"changed_files":3}}