{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/48608233","id":48608233,"diff_hunk":"@@ -341,10 +339,12 @@ defmodule Task do\n   Receives a group of tasks and a message and finds\n   a task that matches the given message.\n \n-  This function returns a tuple with the returned value\n-  in case the message matches a task that exited with\n-  success alongside the matching task. It returns `nil`\n-  if no task was found. It exits if the task has failed.\n+  If the message matches a task that finished normally,\n+  this function returns a tuple with the task's\n+  result and `Task` struct. If the message matches a\n+  task that terminated abnormally, this function will exit.","path":"lib/elixir/lib/task.ex","position":187,"original_position":187,"commit_id":"70cd9a27ddb74cf4c079d6a7c8cbc9961053ef57","original_commit_id":"70cd9a27ddb74cf4c079d6a7c8cbc9961053ef57","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":"Yes, it was meant to mirror await. Plus we cannot change it because it\nwould be backwards incompatible.\n\nOn Wednesday, December 30, 2015, Alexei Sholik <notifications@github.com>\nwrote:\n\n> In lib/elixir/lib/task.ex\n> <https://github.com/elixir-lang/elixir/pull/4128#discussion_r48607917>:\n>\n> > @@ -341,10 +339,12 @@ defmodule Task do\n> >    Receives a group of tasks and a message and finds\n> >    a task that matches the given message.\n> >\n> > -  This function returns a tuple with the returned value\n> > -  in case the message matches a task that exited with\n> > -  success alongside the matching task. It returns `nil`\n> > -  if no task was found. It exits if the task has failed.\n> > +  If the message matches a task that finished normally,\n> > +  this function returns a tuple with the task's\n> > +  result and `Task` struct. If the message matches a\n> > +  task that terminated abnormally, this function will exit.\n>\n> OK, so I had to read the source code to finally understand what this\n> function is doing. What do you think about the following wording:\n>\n>   If the message matches a task that finished normally,\n>   this function returns a tuple with the task's\n>   result and `Task` struct. If the message matches a\n>   task that terminated before sending its result back,\n>   this function will exit.\n>\n> I didn't want to say just \"terminated\" because that is more likely to\n> raise question about the exact semantics.\n>\n> As a slight offtopic, the exiting behaviour of this function surprises me.\n> If the common use case for find is to check whether an incoming message\n> is related to a task, I would expect to get an error tuple back for a\n> prematurely terminated task. I guess this current behaviour is supposed to\n> mirror what happens when you await?\n>\n> /cc @josevalim <https://github.com/josevalim>\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/elixir-lang/elixir/pull/4128/files#r48607917>.\n>\n\n\n-- \n\n\n*José Valimwww.plataformatec.com.br\n<http://www.plataformatec.com.br/>Founder and Director of R&D*\n","created_at":"2015-12-30T15:04:42Z","updated_at":"2015-12-30T15:04:42Z","html_url":"https://github.com/elixir-lang/elixir/pull/4128#discussion_r48608233","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/48608233"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4128#discussion_r48608233"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128","id":54790841,"html_url":"https://github.com/elixir-lang/elixir/pull/4128","diff_url":"https://github.com/elixir-lang/elixir/pull/4128.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/4128.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4128","number":4128,"state":"open","locked":false,"title":"Multiple small fixes in the Task and Task.Supervisor docs.","user":{"login":"alco","id":207748,"avatar_url":"https://avatars.githubusercontent.com/u/207748?v=3","gravatar_id":"","url":"https://api.github.com/users/alco","html_url":"https://github.com/alco","followers_url":"https://api.github.com/users/alco/followers","following_url":"https://api.github.com/users/alco/following{/other_user}","gists_url":"https://api.github.com/users/alco/gists{/gist_id}","starred_url":"https://api.github.com/users/alco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alco/subscriptions","organizations_url":"https://api.github.com/users/alco/orgs","repos_url":"https://api.github.com/users/alco/repos","events_url":"https://api.github.com/users/alco/events{/privacy}","received_events_url":"https://api.github.com/users/alco/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-30T10:35:21Z","updated_at":"2015-12-30T15:04:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"061ebde725d52b288b2a74e3e7bee161bc0b433f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4128/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/70cd9a27ddb74cf4c079d6a7c8cbc9961053ef57","head":{"label":"alco:alco/task-doc-improvements","ref":"alco/task-doc-improvements","sha":"70cd9a27ddb74cf4c079d6a7c8cbc9961053ef57","user":{"login":"alco","id":207748,"avatar_url":"https://avatars.githubusercontent.com/u/207748?v=3","gravatar_id":"","url":"https://api.github.com/users/alco","html_url":"https://github.com/alco","followers_url":"https://api.github.com/users/alco/followers","following_url":"https://api.github.com/users/alco/following{/other_user}","gists_url":"https://api.github.com/users/alco/gists{/gist_id}","starred_url":"https://api.github.com/users/alco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alco/subscriptions","organizations_url":"https://api.github.com/users/alco/orgs","repos_url":"https://api.github.com/users/alco/repos","events_url":"https://api.github.com/users/alco/events{/privacy}","received_events_url":"https://api.github.com/users/alco/received_events","type":"User","site_admin":false},"repo":{"id":3815790,"name":"elixir","full_name":"alco/elixir","owner":{"login":"alco","id":207748,"avatar_url":"https://avatars.githubusercontent.com/u/207748?v=3","gravatar_id":"","url":"https://api.github.com/users/alco","html_url":"https://github.com/alco","followers_url":"https://api.github.com/users/alco/followers","following_url":"https://api.github.com/users/alco/following{/other_user}","gists_url":"https://api.github.com/users/alco/gists{/gist_id}","starred_url":"https://api.github.com/users/alco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alco/subscriptions","organizations_url":"https://api.github.com/users/alco/orgs","repos_url":"https://api.github.com/users/alco/repos","events_url":"https://api.github.com/users/alco/events{/privacy}","received_events_url":"https://api.github.com/users/alco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alco/elixir","description":"A modern approach to programming for the Erlang VM","fork":true,"url":"https://api.github.com/repos/alco/elixir","forks_url":"https://api.github.com/repos/alco/elixir/forks","keys_url":"https://api.github.com/repos/alco/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alco/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alco/elixir/teams","hooks_url":"https://api.github.com/repos/alco/elixir/hooks","issue_events_url":"https://api.github.com/repos/alco/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/alco/elixir/events","assignees_url":"https://api.github.com/repos/alco/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/alco/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/alco/elixir/tags","blobs_url":"https://api.github.com/repos/alco/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alco/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alco/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/alco/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alco/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/alco/elixir/languages","stargazers_url":"https://api.github.com/repos/alco/elixir/stargazers","contributors_url":"https://api.github.com/repos/alco/elixir/contributors","subscribers_url":"https://api.github.com/repos/alco/elixir/subscribers","subscription_url":"https://api.github.com/repos/alco/elixir/subscription","commits_url":"https://api.github.com/repos/alco/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/alco/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/alco/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/alco/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/alco/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/alco/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alco/elixir/merges","archive_url":"https://api.github.com/repos/alco/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alco/elixir/downloads","issues_url":"https://api.github.com/repos/alco/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/alco/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/alco/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/alco/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alco/elixir/labels{/name}","releases_url":"https://api.github.com/repos/alco/elixir/releases{/id}","created_at":"2012-03-24T07:48:47Z","updated_at":"2015-12-22T02:46:37Z","pushed_at":"2015-12-30T14:19:40Z","git_url":"git://github.com/alco/elixir.git","ssh_url":"git@github.com:alco/elixir.git","clone_url":"https://github.com/alco/elixir.git","svn_url":"https://github.com/alco/elixir","homepage":"http://elixir-lang.org/","size":32820,"stargazers_count":17,"watchers_count":17,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":17,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"65ec10839941065f77aa21f9639e1ac65dcd0709","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","created_at":"2011-01-09T08:43:57Z","updated_at":"2015-12-30T12:59:25Z","pushed_at":"2015-12-30T12:55:21Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":40969,"stargazers_count":5729,"watchers_count":5729,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":796,"mirror_url":null,"open_issues_count":40,"forks":796,"open_issues":40,"watchers":5729,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4128"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4128"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4128/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4128/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/70cd9a27ddb74cf4c079d6a7c8cbc9961053ef57"}}}}