GitHub PullRequestReviewCommentEvent at 2014-12-07 11:09:17
Repository: postgrex
Actor: josevalim
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ericmj/postgrex/pulls/comments/21423607","id":21423607,"diff_hunk":"@@ -446,6 +483,26 @@ defmodule Postgrex.Connection do\n     end\n   end\n \n+  defp command({:listen, channel, pid, _opts}, %{listeners: listeners} = s) do\n+    # Subscribe `pid` to listen to `channel` notifications.","path":"lib/postgrex/connection.ex","position":58,"original_position":58,"commit_id":"beea26e8461f0d57dea3d4a2a40b822f7f1edbf0","original_commit_id":"beea26e8461f0d57dea3d4a2a40b822f7f1edbf0","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"@ericmj should we monitor the given process?","created_at":"2014-12-07T11:09:17Z","updated_at":"2014-12-07T11:09:17Z","html_url":"https://github.com/ericmj/postgrex/pull/29#discussion_r21423607","pull_request_url":"https://api.github.com/repos/ericmj/postgrex/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/comments/21423607"},"html":{"href":"https://github.com/ericmj/postgrex/pull/29#discussion_r21423607"},"pull_request":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/ericmj/postgrex/pulls/29","id":25614141,"html_url":"https://github.com/ericmj/postgrex/pull/29","diff_url":"https://github.com/ericmj/postgrex/pull/29.diff","patch_url":"https://github.com/ericmj/postgrex/pull/29.patch","issue_url":"https://api.github.com/repos/ericmj/postgrex/issues/29","number":29,"state":"open","locked":false,"title":"LISTEN / NOTIFY support","user":{"login":"keichan34","id":1064513,"avatar_url":"https://avatars.githubusercontent.com/u/1064513?v=3","gravatar_id":"","url":"https://api.github.com/users/keichan34","html_url":"https://github.com/keichan34","followers_url":"https://api.github.com/users/keichan34/followers","following_url":"https://api.github.com/users/keichan34/following{/other_user}","gists_url":"https://api.github.com/users/keichan34/gists{/gist_id}","starred_url":"https://api.github.com/users/keichan34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keichan34/subscriptions","organizations_url":"https://api.github.com/users/keichan34/orgs","repos_url":"https://api.github.com/users/keichan34/repos","events_url":"https://api.github.com/users/keichan34/events{/privacy}","received_events_url":"https://api.github.com/users/keichan34/received_events","type":"User","site_admin":false},"body":"Continuation of discussion on #28 \r\n\r\nI've implemented direct messaging instead of GenEvent, storing the PID of the caller on `Postgrex.Connection.listen/3` and removing it on `Postgrex.Connection.unlisten/3`.\r\n\r\nI've implemented dead-process checking by using `Process.alive?` before sending the notification, but I wonder if there is a better way to do it? I suppose we could delete the process from the HashSet when it's detected to be dead, and when the HashSet size reduces to 0 we can send an UNLISTEN query to the server?","created_at":"2014-12-06T03:41:08Z","updated_at":"2014-12-07T11:09:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f33672a58a51f6cd025346245ef40831a1fc9f0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ericmj/postgrex/pulls/29/commits","review_comments_url":"https://api.github.com/repos/ericmj/postgrex/pulls/29/comments","review_comment_url":"https://api.github.com/repos/ericmj/postgrex/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ericmj/postgrex/issues/29/comments","statuses_url":"https://api.github.com/repos/ericmj/postgrex/statuses/beea26e8461f0d57dea3d4a2a40b822f7f1edbf0","head":{"label":"keichan34:listen-notify","ref":"listen-notify","sha":"beea26e8461f0d57dea3d4a2a40b822f7f1edbf0","user":{"login":"keichan34","id":1064513,"avatar_url":"https://avatars.githubusercontent.com/u/1064513?v=3","gravatar_id":"","url":"https://api.github.com/users/keichan34","html_url":"https://github.com/keichan34","followers_url":"https://api.github.com/users/keichan34/followers","following_url":"https://api.github.com/users/keichan34/following{/other_user}","gists_url":"https://api.github.com/users/keichan34/gists{/gist_id}","starred_url":"https://api.github.com/users/keichan34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keichan34/subscriptions","organizations_url":"https://api.github.com/users/keichan34/orgs","repos_url":"https://api.github.com/users/keichan34/repos","events_url":"https://api.github.com/users/keichan34/events{/privacy}","received_events_url":"https://api.github.com/users/keichan34/received_events","type":"User","site_admin":false},"repo":{"id":27435418,"name":"postgrex","full_name":"keichan34/postgrex","owner":{"login":"keichan34","id":1064513,"avatar_url":"https://avatars.githubusercontent.com/u/1064513?v=3","gravatar_id":"","url":"https://api.github.com/users/keichan34","html_url":"https://github.com/keichan34","followers_url":"https://api.github.com/users/keichan34/followers","following_url":"https://api.github.com/users/keichan34/following{/other_user}","gists_url":"https://api.github.com/users/keichan34/gists{/gist_id}","starred_url":"https://api.github.com/users/keichan34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keichan34/subscriptions","organizations_url":"https://api.github.com/users/keichan34/orgs","repos_url":"https://api.github.com/users/keichan34/repos","events_url":"https://api.github.com/users/keichan34/events{/privacy}","received_events_url":"https://api.github.com/users/keichan34/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/keichan34/postgrex","description":"PostgreSQL driver for Elixir","fork":true,"url":"https://api.github.com/repos/keichan34/postgrex","forks_url":"https://api.github.com/repos/keichan34/postgrex/forks","keys_url":"https://api.github.com/repos/keichan34/postgrex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keichan34/postgrex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keichan34/postgrex/teams","hooks_url":"https://api.github.com/repos/keichan34/postgrex/hooks","issue_events_url":"https://api.github.com/repos/keichan34/postgrex/issues/events{/number}","events_url":"https://api.github.com/repos/keichan34/postgrex/events","assignees_url":"https://api.github.com/repos/keichan34/postgrex/assignees{/user}","branches_url":"https://api.github.com/repos/keichan34/postgrex/branches{/branch}","tags_url":"https://api.github.com/repos/keichan34/postgrex/tags","blobs_url":"https://api.github.com/repos/keichan34/postgrex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keichan34/postgrex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keichan34/postgrex/git/refs{/sha}","trees_url":"https://api.github.com/repos/keichan34/postgrex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keichan34/postgrex/statuses/{sha}","languages_url":"https://api.github.com/repos/keichan34/postgrex/languages","stargazers_url":"https://api.github.com/repos/keichan34/postgrex/stargazers","contributors_url":"https://api.github.com/repos/keichan34/postgrex/contributors","subscribers_url":"https://api.github.com/repos/keichan34/postgrex/subscribers","subscription_url":"https://api.github.com/repos/keichan34/postgrex/subscription","commits_url":"https://api.github.com/repos/keichan34/postgrex/commits{/sha}","git_commits_url":"https://api.github.com/repos/keichan34/postgrex/git/commits{/sha}","comments_url":"https://api.github.com/repos/keichan34/postgrex/comments{/number}","issue_comment_url":"https://api.github.com/repos/keichan34/postgrex/issues/comments/{number}","contents_url":"https://api.github.com/repos/keichan34/postgrex/contents/{+path}","compare_url":"https://api.github.com/repos/keichan34/postgrex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keichan34/postgrex/merges","archive_url":"https://api.github.com/repos/keichan34/postgrex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keichan34/postgrex/downloads","issues_url":"https://api.github.com/repos/keichan34/postgrex/issues{/number}","pulls_url":"https://api.github.com/repos/keichan34/postgrex/pulls{/number}","milestones_url":"https://api.github.com/repos/keichan34/postgrex/milestones{/number}","notifications_url":"https://api.github.com/repos/keichan34/postgrex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keichan34/postgrex/labels{/name}","releases_url":"https://api.github.com/repos/keichan34/postgrex/releases{/id}","created_at":"2014-12-02T14:13:37Z","updated_at":"2014-12-02T14:13:37Z","pushed_at":"2014-12-06T04:12:35Z","git_url":"git://github.com/keichan34/postgrex.git","ssh_url":"git@github.com:keichan34/postgrex.git","clone_url":"https://github.com/keichan34/postgrex.git","svn_url":"https://github.com/keichan34/postgrex","homepage":"http://hexdocs.pm/postgrex/","size":466,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ericmj:master","ref":"master","sha":"8026a65a786730d04cf4c74038ed38d25bb019e2","user":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"repo":{"id":12682522,"name":"postgrex","full_name":"ericmj/postgrex","owner":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericmj/postgrex","description":"PostgreSQL driver for Elixir","fork":false,"url":"https://api.github.com/repos/ericmj/postgrex","forks_url":"https://api.github.com/repos/ericmj/postgrex/forks","keys_url":"https://api.github.com/repos/ericmj/postgrex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericmj/postgrex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericmj/postgrex/teams","hooks_url":"https://api.github.com/repos/ericmj/postgrex/hooks","issue_events_url":"https://api.github.com/repos/ericmj/postgrex/issues/events{/number}","events_url":"https://api.github.com/repos/ericmj/postgrex/events","assignees_url":"https://api.github.com/repos/ericmj/postgrex/assignees{/user}","branches_url":"https://api.github.com/repos/ericmj/postgrex/branches{/branch}","tags_url":"https://api.github.com/repos/ericmj/postgrex/tags","blobs_url":"https://api.github.com/repos/ericmj/postgrex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericmj/postgrex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericmj/postgrex/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericmj/postgrex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericmj/postgrex/statuses/{sha}","languages_url":"https://api.github.com/repos/ericmj/postgrex/languages","stargazers_url":"https://api.github.com/repos/ericmj/postgrex/stargazers","contributors_url":"https://api.github.com/repos/ericmj/postgrex/contributors","subscribers_url":"https://api.github.com/repos/ericmj/postgrex/subscribers","subscription_url":"https://api.github.com/repos/ericmj/postgrex/subscription","commits_url":"https://api.github.com/repos/ericmj/postgrex/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericmj/postgrex/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericmj/postgrex/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericmj/postgrex/issues/comments/{number}","contents_url":"https://api.github.com/repos/ericmj/postgrex/contents/{+path}","compare_url":"https://api.github.com/repos/ericmj/postgrex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericmj/postgrex/merges","archive_url":"https://api.github.com/repos/ericmj/postgrex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericmj/postgrex/downloads","issues_url":"https://api.github.com/repos/ericmj/postgrex/issues{/number}","pulls_url":"https://api.github.com/repos/ericmj/postgrex/pulls{/number}","milestones_url":"https://api.github.com/repos/ericmj/postgrex/milestones{/number}","notifications_url":"https://api.github.com/repos/ericmj/postgrex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericmj/postgrex/labels{/name}","releases_url":"https://api.github.com/repos/ericmj/postgrex/releases{/id}","created_at":"2013-09-08T15:10:47Z","updated_at":"2014-12-06T18:25:13Z","pushed_at":"2014-10-21T19:09:51Z","git_url":"git://github.com/ericmj/postgrex.git","ssh_url":"git@github.com:ericmj/postgrex.git","clone_url":"https://github.com/ericmj/postgrex.git","svn_url":"https://github.com/ericmj/postgrex","homepage":"http://hexdocs.pm/postgrex/","size":1611,"stargazers_count":81,"watchers_count":81,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":6,"forks":18,"open_issues":6,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/29"},"html":{"href":"https://github.com/ericmj/postgrex/pull/29"},"issue":{"href":"https://api.github.com/repos/ericmj/postgrex/issues/29"},"comments":{"href":"https://api.github.com/repos/ericmj/postgrex/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ericmj/postgrex/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/ericmj/postgrex/statuses/beea26e8461f0d57dea3d4a2a40b822f7f1edbf0"}}}}