{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/sarama/pulls/comments/26505456","id":26505456,"diff_hunk":"@@ -594,13 +594,14 @@ func ExampleProducer_select() {\n ProducerLoop:\n \tfor {\n \t\tselect {\n-\t\tcase producer.Input() <- &ProducerMessage{Topic: \"my_topic\", Key: nil, Value: StringEncoder(\"testing 123\")}:\n-\t\t\tenqueued++\n \t\tcase err := <-producer.Errors():\n \t\t\tlog.Println(\"Failed to produce message\", err)\n \t\t\terrors++\n \t\tcase <-signals:\n \t\t\tbreak ProducerLoop\n+\t\tdefault:\n+\t\t\tproducer.EnqueueMessage(&ProducerMessage{Topic: \"my_topic\", Key: nil, Value: StringEncoder(\"testing 123\")})","path":"async_producer_test.go","position":187,"original_position":187,"commit_id":"b3366d211c528f6fcd632140ae87d0907546395f","original_commit_id":"b3366d211c528f6fcd632140ae87d0907546395f","user":{"login":"eapache","id":1706826,"avatar_url":"https://avatars.githubusercontent.com/u/1706826?v=3","gravatar_id":"","url":"https://api.github.com/users/eapache","html_url":"https://github.com/eapache","followers_url":"https://api.github.com/users/eapache/followers","following_url":"https://api.github.com/users/eapache/following{/other_user}","gists_url":"https://api.github.com/users/eapache/gists{/gist_id}","starred_url":"https://api.github.com/users/eapache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eapache/subscriptions","organizations_url":"https://api.github.com/users/eapache/orgs","repos_url":"https://api.github.com/users/eapache/repos","events_url":"https://api.github.com/users/eapache/events{/privacy}","received_events_url":"https://api.github.com/users/eapache/received_events","type":"User","site_admin":false},"body":"this can now deadlock, which is a problem","created_at":"2015-03-16T17:09:08Z","updated_at":"2015-03-16T17:09:08Z","html_url":"https://github.com/Shopify/sarama/pull/350#discussion_r26505456","pull_request_url":"https://api.github.com/repos/Shopify/sarama/pulls/350","_links":{"self":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/comments/26505456"},"html":{"href":"https://github.com/Shopify/sarama/pull/350#discussion_r26505456"},"pull_request":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/350"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/sarama/pulls/350","id":31263037,"html_url":"https://github.com/Shopify/sarama/pull/350","diff_url":"https://github.com/Shopify/sarama/pull/350.diff","patch_url":"https://github.com/Shopify/sarama/pull/350.patch","issue_url":"https://api.github.com/repos/Shopify/sarama/issues/350","number":350,"state":"open","locked":false,"title":"Producer API proposals","user":{"login":"wvanbergen","id":15870,"avatar_url":"https://avatars.githubusercontent.com/u/15870?v=3","gravatar_id":"","url":"https://api.github.com/users/wvanbergen","html_url":"https://github.com/wvanbergen","followers_url":"https://api.github.com/users/wvanbergen/followers","following_url":"https://api.github.com/users/wvanbergen/following{/other_user}","gists_url":"https://api.github.com/users/wvanbergen/gists{/gist_id}","starred_url":"https://api.github.com/users/wvanbergen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvanbergen/subscriptions","organizations_url":"https://api.github.com/users/wvanbergen/orgs","repos_url":"https://api.github.com/users/wvanbergen/repos","events_url":"https://api.github.com/users/wvanbergen/events{/privacy}","received_events_url":"https://api.github.com/users/wvanbergen/received_events","type":"User","site_admin":false},"body":"Before we call a 1.0 on the API, I'd like to propose 3 final API changes for the Producer. I'm not 100% sure about any of these, but I would like to bring them up before it is too late.\r\n\r\n1. **`Producer` -> `AsyncProducer`**: This is mostly to make it more clear that we have 2 different APIs available, and force people to make a decision. Right now, many people will use the async producer because it is called producer, even though it is more complicated to use. So I rather let people decide what suits their use case best. If we have to pick a default, I'd use the sync producer because it's easier to get started with.\r\n\r\n2. **`Input() <- msg` -> `EnqueueMessage(msg)`**: This is more in line with the `SyncProducer`. Also several people have indicated that the API uses too many channels. The main disadvantage is that you cannot use it in a `select` statement anymore.\r\n\r\n3. **Make `Offset` and `Partition` of `ProducerMessage` fields instead of methods.** This is more in line with `ConsumerMessage`. Also it allows the mock producer to assign offsets to the messages it returns. Finally, we could add a `ManualPartitioner` that simply produces the message to the Partition set on it.\r\n\r\n@Shopify/kafka","created_at":"2015-03-16T17:04:19Z","updated_at":"2015-03-16T17:09:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3edac83dec647ad312cab575dc13e94b5669f22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/sarama/pulls/350/commits","review_comments_url":"https://api.github.com/repos/Shopify/sarama/pulls/350/comments","review_comment_url":"https://api.github.com/repos/Shopify/sarama/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/sarama/issues/350/comments","statuses_url":"https://api.github.com/repos/Shopify/sarama/statuses/b3366d211c528f6fcd632140ae87d0907546395f","head":{"label":"Shopify:async_producer","ref":"async_producer","sha":"b3366d211c528f6fcd632140ae87d0907546395f","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":11206255,"name":"sarama","full_name":"Shopify/sarama","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/sarama","description":"Sarama is a Go library for Apache Kafka 0.8 ","fork":false,"url":"https://api.github.com/repos/Shopify/sarama","forks_url":"https://api.github.com/repos/Shopify/sarama/forks","keys_url":"https://api.github.com/repos/Shopify/sarama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/sarama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/sarama/teams","hooks_url":"https://api.github.com/repos/Shopify/sarama/hooks","issue_events_url":"https://api.github.com/repos/Shopify/sarama/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/sarama/events","assignees_url":"https://api.github.com/repos/Shopify/sarama/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/sarama/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/sarama/tags","blobs_url":"https://api.github.com/repos/Shopify/sarama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/sarama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/sarama/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/sarama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/sarama/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/sarama/languages","stargazers_url":"https://api.github.com/repos/Shopify/sarama/stargazers","contributors_url":"https://api.github.com/repos/Shopify/sarama/contributors","subscribers_url":"https://api.github.com/repos/Shopify/sarama/subscribers","subscription_url":"https://api.github.com/repos/Shopify/sarama/subscription","commits_url":"https://api.github.com/repos/Shopify/sarama/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/sarama/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/sarama/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/sarama/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/sarama/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/sarama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/sarama/merges","archive_url":"https://api.github.com/repos/Shopify/sarama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/sarama/downloads","issues_url":"https://api.github.com/repos/Shopify/sarama/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/sarama/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/sarama/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/sarama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/sarama/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/sarama/releases{/id}","created_at":"2013-07-05T18:52:38Z","updated_at":"2015-03-16T16:51:09Z","pushed_at":"2015-03-16T16:56:35Z","git_url":"git://github.com/Shopify/sarama.git","ssh_url":"git@github.com:Shopify/sarama.git","clone_url":"https://github.com/Shopify/sarama.git","svn_url":"https://github.com/Shopify/sarama","homepage":"http://shopify.github.io/sarama","size":6576,"stargazers_count":380,"watchers_count":380,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":22,"forks":68,"open_issues":22,"watchers":380,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"6b43c8dd0aea10808a290d499486ccc8fe331d05","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":11206255,"name":"sarama","full_name":"Shopify/sarama","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/sarama","description":"Sarama is a Go library for Apache Kafka 0.8 ","fork":false,"url":"https://api.github.com/repos/Shopify/sarama","forks_url":"https://api.github.com/repos/Shopify/sarama/forks","keys_url":"https://api.github.com/repos/Shopify/sarama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/sarama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/sarama/teams","hooks_url":"https://api.github.com/repos/Shopify/sarama/hooks","issue_events_url":"https://api.github.com/repos/Shopify/sarama/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/sarama/events","assignees_url":"https://api.github.com/repos/Shopify/sarama/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/sarama/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/sarama/tags","blobs_url":"https://api.github.com/repos/Shopify/sarama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/sarama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/sarama/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/sarama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/sarama/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/sarama/languages","stargazers_url":"https://api.github.com/repos/Shopify/sarama/stargazers","contributors_url":"https://api.github.com/repos/Shopify/sarama/contributors","subscribers_url":"https://api.github.com/repos/Shopify/sarama/subscribers","subscription_url":"https://api.github.com/repos/Shopify/sarama/subscription","commits_url":"https://api.github.com/repos/Shopify/sarama/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/sarama/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/sarama/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/sarama/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/sarama/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/sarama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/sarama/merges","archive_url":"https://api.github.com/repos/Shopify/sarama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/sarama/downloads","issues_url":"https://api.github.com/repos/Shopify/sarama/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/sarama/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/sarama/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/sarama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/sarama/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/sarama/releases{/id}","created_at":"2013-07-05T18:52:38Z","updated_at":"2015-03-16T16:51:09Z","pushed_at":"2015-03-16T16:56:35Z","git_url":"git://github.com/Shopify/sarama.git","ssh_url":"git@github.com:Shopify/sarama.git","clone_url":"https://github.com/Shopify/sarama.git","svn_url":"https://github.com/Shopify/sarama","homepage":"http://shopify.github.io/sarama","size":6576,"stargazers_count":380,"watchers_count":380,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":22,"forks":68,"open_issues":22,"watchers":380,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/350"},"html":{"href":"https://github.com/Shopify/sarama/pull/350"},"issue":{"href":"https://api.github.com/repos/Shopify/sarama/issues/350"},"comments":{"href":"https://api.github.com/repos/Shopify/sarama/issues/350/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/350/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/sarama/pulls/350/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/sarama/statuses/b3366d211c528f6fcd632140ae87d0907546395f"}}}}