{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/comments/118848554","pull_request_review_id":40679121,"id":118848554,"diff_hunk":"@@ -29,6 +29,13 @@ defmodule Postgrex.Producer do\n     execute on error, otherwise set to `:transaction` (default: `:transaction`);\n \n   The pool may support other options.\n+\n+  ## Examples\n+\n+      {:ok, pid} = Postgrex.Producer.start_link(pool, \"SELECT * FROM posts, [])\n+      [{pid, [cancel: :transient]}]\n+      |> GenStage.stream()","path":"lib/postgrex/producer.ex","position":37,"original_position":9,"commit_id":"f9f2ae1ca374d462ff86622951fbd216f28d74f0","original_commit_id":"f9f2ae1ca374d462ff86622951fbd216f28d74f0","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars3.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":"Instead of this example, let's make an imaginary consumer subscribe to the producer. That's because this use case is better done with streams.","created_at":"2017-05-28T20:21:10Z","updated_at":"2017-05-28T20:21:10Z","html_url":"https://github.com/elixir-ecto/postgrex/pull/312#discussion_r118848554","pull_request_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312","_links":{"self":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/comments/118848554"},"html":{"href":"https://github.com/elixir-ecto/postgrex/pull/312#discussion_r118848554"},"pull_request":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312","id":115434811,"html_url":"https://github.com/elixir-ecto/postgrex/pull/312","diff_url":"https://github.com/elixir-ecto/postgrex/pull/312.diff","patch_url":"https://github.com/elixir-ecto/postgrex/pull/312.patch","issue_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/312","number":312,"state":"open","locked":false,"title":"Introduce Postgrex.Stage","user":{"login":"fishcakez","id":2001229,"avatar_url":"https://avatars0.githubusercontent.com/u/2001229?v=3","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false},"body":"This is WIP. Includes a common real world example of a `:consumer` stage.","created_at":"2017-04-11T23:16:42Z","updated_at":"2017-05-28T20:21:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92c20fe106dd358ed70e9e1fefd6489e06ae55a7","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312/commits","review_comments_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312/comments","review_comment_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/312/comments","statuses_url":"https://api.github.com/repos/elixir-ecto/postgrex/statuses/f9f2ae1ca374d462ff86622951fbd216f28d74f0","head":{"label":"elixir-ecto:jf-stage","ref":"jf-stage","sha":"f9f2ae1ca374d462ff86622951fbd216f28d74f0","user":{"login":"elixir-ecto","id":19973437,"avatar_url":"https://avatars0.githubusercontent.com/u/19973437?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-ecto","html_url":"https://github.com/elixir-ecto","followers_url":"https://api.github.com/users/elixir-ecto/followers","following_url":"https://api.github.com/users/elixir-ecto/following{/other_user}","gists_url":"https://api.github.com/users/elixir-ecto/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-ecto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-ecto/subscriptions","organizations_url":"https://api.github.com/users/elixir-ecto/orgs","repos_url":"https://api.github.com/users/elixir-ecto/repos","events_url":"https://api.github.com/users/elixir-ecto/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-ecto/received_events","type":"Organization","site_admin":false},"repo":{"id":12682522,"name":"postgrex","full_name":"elixir-ecto/postgrex","owner":{"login":"elixir-ecto","id":19973437,"avatar_url":"https://avatars0.githubusercontent.com/u/19973437?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-ecto","html_url":"https://github.com/elixir-ecto","followers_url":"https://api.github.com/users/elixir-ecto/followers","following_url":"https://api.github.com/users/elixir-ecto/following{/other_user}","gists_url":"https://api.github.com/users/elixir-ecto/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-ecto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-ecto/subscriptions","organizations_url":"https://api.github.com/users/elixir-ecto/orgs","repos_url":"https://api.github.com/users/elixir-ecto/repos","events_url":"https://api.github.com/users/elixir-ecto/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-ecto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-ecto/postgrex","description":"PostgreSQL driver for Elixir","fork":false,"url":"https://api.github.com/repos/elixir-ecto/postgrex","forks_url":"https://api.github.com/repos/elixir-ecto/postgrex/forks","keys_url":"https://api.github.com/repos/elixir-ecto/postgrex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-ecto/postgrex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-ecto/postgrex/teams","hooks_url":"https://api.github.com/repos/elixir-ecto/postgrex/hooks","issue_events_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-ecto/postgrex/events","assignees_url":"https://api.github.com/repos/elixir-ecto/postgrex/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-ecto/postgrex/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-ecto/postgrex/tags","blobs_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-ecto/postgrex/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-ecto/postgrex/languages","stargazers_url":"https://api.github.com/repos/elixir-ecto/postgrex/stargazers","contributors_url":"https://api.github.com/repos/elixir-ecto/postgrex/contributors","subscribers_url":"https://api.github.com/repos/elixir-ecto/postgrex/subscribers","subscription_url":"https://api.github.com/repos/elixir-ecto/postgrex/subscription","commits_url":"https://api.github.com/repos/elixir-ecto/postgrex/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-ecto/postgrex/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-ecto/postgrex/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-ecto/postgrex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-ecto/postgrex/merges","archive_url":"https://api.github.com/repos/elixir-ecto/postgrex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-ecto/postgrex/downloads","issues_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-ecto/postgrex/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-ecto/postgrex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-ecto/postgrex/labels{/name}","releases_url":"https://api.github.com/repos/elixir-ecto/postgrex/releases{/id}","deployments_url":"https://api.github.com/repos/elixir-ecto/postgrex/deployments","created_at":"2013-09-08T15:10:47Z","updated_at":"2017-05-23T15:20:10Z","pushed_at":"2017-05-28T17:23:57Z","git_url":"git://github.com/elixir-ecto/postgrex.git","ssh_url":"git@github.com:elixir-ecto/postgrex.git","clone_url":"https://github.com/elixir-ecto/postgrex.git","svn_url":"https://github.com/elixir-ecto/postgrex","homepage":"http://hexdocs.pm/postgrex/","size":1258,"stargazers_count":417,"watchers_count":417,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":10,"forks":115,"open_issues":10,"watchers":417,"default_branch":"master"}},"base":{"label":"elixir-ecto:master","ref":"master","sha":"87178f1728200725c264b44fd813243c7149edc1","user":{"login":"elixir-ecto","id":19973437,"avatar_url":"https://avatars0.githubusercontent.com/u/19973437?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-ecto","html_url":"https://github.com/elixir-ecto","followers_url":"https://api.github.com/users/elixir-ecto/followers","following_url":"https://api.github.com/users/elixir-ecto/following{/other_user}","gists_url":"https://api.github.com/users/elixir-ecto/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-ecto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-ecto/subscriptions","organizations_url":"https://api.github.com/users/elixir-ecto/orgs","repos_url":"https://api.github.com/users/elixir-ecto/repos","events_url":"https://api.github.com/users/elixir-ecto/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-ecto/received_events","type":"Organization","site_admin":false},"repo":{"id":12682522,"name":"postgrex","full_name":"elixir-ecto/postgrex","owner":{"login":"elixir-ecto","id":19973437,"avatar_url":"https://avatars0.githubusercontent.com/u/19973437?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-ecto","html_url":"https://github.com/elixir-ecto","followers_url":"https://api.github.com/users/elixir-ecto/followers","following_url":"https://api.github.com/users/elixir-ecto/following{/other_user}","gists_url":"https://api.github.com/users/elixir-ecto/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-ecto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-ecto/subscriptions","organizations_url":"https://api.github.com/users/elixir-ecto/orgs","repos_url":"https://api.github.com/users/elixir-ecto/repos","events_url":"https://api.github.com/users/elixir-ecto/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-ecto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-ecto/postgrex","description":"PostgreSQL driver for Elixir","fork":false,"url":"https://api.github.com/repos/elixir-ecto/postgrex","forks_url":"https://api.github.com/repos/elixir-ecto/postgrex/forks","keys_url":"https://api.github.com/repos/elixir-ecto/postgrex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-ecto/postgrex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-ecto/postgrex/teams","hooks_url":"https://api.github.com/repos/elixir-ecto/postgrex/hooks","issue_events_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-ecto/postgrex/events","assignees_url":"https://api.github.com/repos/elixir-ecto/postgrex/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-ecto/postgrex/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-ecto/postgrex/tags","blobs_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-ecto/postgrex/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-ecto/postgrex/languages","stargazers_url":"https://api.github.com/repos/elixir-ecto/postgrex/stargazers","contributors_url":"https://api.github.com/repos/elixir-ecto/postgrex/contributors","subscribers_url":"https://api.github.com/repos/elixir-ecto/postgrex/subscribers","subscription_url":"https://api.github.com/repos/elixir-ecto/postgrex/subscription","commits_url":"https://api.github.com/repos/elixir-ecto/postgrex/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-ecto/postgrex/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-ecto/postgrex/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-ecto/postgrex/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-ecto/postgrex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-ecto/postgrex/merges","archive_url":"https://api.github.com/repos/elixir-ecto/postgrex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-ecto/postgrex/downloads","issues_url":"https://api.github.com/repos/elixir-ecto/postgrex/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-ecto/postgrex/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-ecto/postgrex/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-ecto/postgrex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-ecto/postgrex/labels{/name}","releases_url":"https://api.github.com/repos/elixir-ecto/postgrex/releases{/id}","deployments_url":"https://api.github.com/repos/elixir-ecto/postgrex/deployments","created_at":"2013-09-08T15:10:47Z","updated_at":"2017-05-23T15:20:10Z","pushed_at":"2017-05-28T17:23:57Z","git_url":"git://github.com/elixir-ecto/postgrex.git","ssh_url":"git@github.com:elixir-ecto/postgrex.git","clone_url":"https://github.com/elixir-ecto/postgrex.git","svn_url":"https://github.com/elixir-ecto/postgrex","homepage":"http://hexdocs.pm/postgrex/","size":1258,"stargazers_count":417,"watchers_count":417,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":10,"forks":115,"open_issues":10,"watchers":417,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312"},"html":{"href":"https://github.com/elixir-ecto/postgrex/pull/312"},"issue":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/issues/312"},"comments":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-ecto/postgrex/statuses/f9f2ae1ca374d462ff86622951fbd216f28d74f0"}}}}
{"actor":{"display_login":"josevalim"}}