{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/61187693","id":61187693,"diff_hunk":"@@ -34,7 +34,17 @@ length(pool::WorkerPool) = pool.count\n isready(pool::WorkerPool) = isready(pool.channel)\n \n function remotecall_pool(rc_f, f, pool::WorkerPool, args...; kwargs...)\n-    worker = take!(pool.channel)\n+    # Find an active worker\n+    while true\n+        pool.count == 0 && throw(ErrorException(\"No active worker available in pool\"))\n+        worker = take!(pool.channel)\n+        if worker in procs()","path":"base/workerpool.jl","position":9,"original_position":9,"commit_id":"5359edf5cebcf87fcff3a11fb476f5b628092893","original_commit_id":"5359edf5cebcf87fcff3a11fb476f5b628092893","user":{"login":"samoconnor","id":8266283,"avatar_url":"https://avatars.githubusercontent.com/u/8266283?v=3","gravatar_id":"","url":"https://api.github.com/users/samoconnor","html_url":"https://github.com/samoconnor","followers_url":"https://api.github.com/users/samoconnor/followers","following_url":"https://api.github.com/users/samoconnor/following{/other_user}","gists_url":"https://api.github.com/users/samoconnor/gists{/gist_id}","starred_url":"https://api.github.com/users/samoconnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samoconnor/subscriptions","organizations_url":"https://api.github.com/users/samoconnor/orgs","repos_url":"https://api.github.com/users/samoconnor/repos","events_url":"https://api.github.com/users/samoconnor/events{/privacy}","received_events_url":"https://api.github.com/users/samoconnor/received_events","type":"User","site_admin":false},"body":"How can it happen that `worker` is not in `procs()`? ","created_at":"2016-04-27T00:32:31Z","updated_at":"2016-04-27T00:32:31Z","html_url":"https://github.com/JuliaLang/julia/pull/15975#discussion_r61187693","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/15975","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/61187693"},"html":{"href":"https://github.com/JuliaLang/julia/pull/15975#discussion_r61187693"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/15975"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/15975","id":67296072,"html_url":"https://github.com/JuliaLang/julia/pull/15975","diff_url":"https://github.com/JuliaLang/julia/pull/15975.diff","patch_url":"https://github.com/JuliaLang/julia/pull/15975.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/15975","number":15975,"state":"open","locked":false,"title":"RFC/WIP configure pmap behavior via keyword args [ci skip]","user":{"login":"amitmurthy","id":117461,"avatar_url":"https://avatars.githubusercontent.com/u/117461?v=3","gravatar_id":"","url":"https://api.github.com/users/amitmurthy","html_url":"https://github.com/amitmurthy","followers_url":"https://api.github.com/users/amitmurthy/followers","following_url":"https://api.github.com/users/amitmurthy/following{/other_user}","gists_url":"https://api.github.com/users/amitmurthy/gists{/gist_id}","starred_url":"https://api.github.com/users/amitmurthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitmurthy/subscriptions","organizations_url":"https://api.github.com/users/amitmurthy/orgs","repos_url":"https://api.github.com/users/amitmurthy/repos","events_url":"https://api.github.com/users/amitmurthy/events{/privacy}","received_events_url":"https://api.github.com/users/amitmurthy/received_events","type":"User","site_admin":false},"body":"This PR enables customization of the new pmap implementation via keyword args.\r\n\r\n`distributed=true`\r\n-----------------------\r\nBy default `pmap` is a parallel map using all available workers. With `distributed=false`, the parallelization is limited to using tasks in the current process and can be used in place of `@sync` / `@async` blocks. For example, we may want to retrieve data from other processes in parallel using a construction like \r\n\r\n```\r\nresults=Array(Any, nworkers())\r\n@sync begin\r\n    for (idx,p) in enumerate(workers())\r\n        @async results[idx] = remotecall_fetch(foo, p, args...)\r\n    end\r\nend\r\n```\r\nwhich can now be written as\r\n\r\n```\r\nresults=pmap(p->remotecall_fetch(foo, p, args...), workers(); distributed=false) \r\n```\r\n\r\n`batch_size=1`\r\n-------------------  \r\n By default, pmap will not perform any batching. You may specify an explicit integer value for the `batch_size`, or specify `batch_size=:auto` wherein `pmap` will create batches depending on the number of workers available.\r\n\r\n`on_error = e->rethrow(e)`\r\n-----------------------------------\r\nBy default, `pmap` will stop on any error. Users may override this behavior by supplying an `on_error` function. For example, `on_error =  e -> e` will simply return the exception inline or `on_error = e -> SOME_ERROR_CODE` will return an error code value inline in the results.\r\n   ","created_at":"2016-04-21T04:41:47Z","updated_at":"2016-04-27T00:32:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9558112b87cfd30c44af4975bb4404698c93350","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/15975/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/15975/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/15975/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/5359edf5cebcf87fcff3a11fb476f5b628092893","head":{"label":"JuliaLang:amitm/pmap_error","ref":"amitm/pmap_error","sha":"5359edf5cebcf87fcff3a11fb476f5b628092893","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2016-04-26T19:48:34Z","pushed_at":"2016-04-26T23:22:45Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":383386,"stargazers_count":6995,"watchers_count":6995,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1613,"mirror_url":null,"open_issues_count":1724,"forks":1613,"open_issues":1724,"watchers":6995,"default_branch":"master"}},"base":{"label":"JuliaLang:master","ref":"master","sha":"2e4513b25ec395df1a6a36840f8abbbece9fa5c3","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2016-04-26T19:48:34Z","pushed_at":"2016-04-26T23:22:45Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":383386,"stargazers_count":6995,"watchers_count":6995,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1613,"mirror_url":null,"open_issues_count":1724,"forks":1613,"open_issues":1724,"watchers":6995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/15975"},"html":{"href":"https://github.com/JuliaLang/julia/pull/15975"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/15975"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/15975/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/15975/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/15975/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/5359edf5cebcf87fcff3a11fb476f5b628092893"}}}}