{"action":"created","issue":{"url":"https://api.github.com/repos/meh/ruby-thread/issues/38","labels_url":"https://api.github.com/repos/meh/ruby-thread/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/meh/ruby-thread/issues/38/comments","events_url":"https://api.github.com/repos/meh/ruby-thread/issues/38/events","html_url":"https://github.com/meh/ruby-thread/issues/38","id":77732794,"number":38,"title":"Cannot run methods in pool.process block?","user":{"login":"hackeron","id":578881,"avatar_url":"https://avatars.githubusercontent.com/u/578881?v=3","gravatar_id":"","url":"https://api.github.com/users/hackeron","html_url":"https://github.com/hackeron","followers_url":"https://api.github.com/users/hackeron/followers","following_url":"https://api.github.com/users/hackeron/following{/other_user}","gists_url":"https://api.github.com/users/hackeron/gists{/gist_id}","starred_url":"https://api.github.com/users/hackeron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackeron/subscriptions","organizations_url":"https://api.github.com/users/hackeron/orgs","repos_url":"https://api.github.com/users/hackeron/repos","events_url":"https://api.github.com/users/hackeron/events{/privacy}","received_events_url":"https://api.github.com/users/hackeron/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-18T17:14:56Z","updated_at":"2015-05-18T17:33:18Z","closed_at":"2015-05-18T17:28:49Z","body":"I have this code:\r\n\r\n```ruby\r\nrequire 'thread/pool'\r\n\r\npool = Thread.pool(10)\r\n\r\ndef provision(serial)\r\n  puts serial\r\n  sleep rand(10)\r\nend\r\n\r\nserials = 1..100\r\nserials.each do |serial|\r\n  pool.process { privision(serial) }\r\nend\r\n\r\npool.shutdown\r\n```\r\n\r\nThis code exits immediately instead of running the provision method.\r\n\r\n```\r\n$ time ruby run.rb \r\nruby run.rb  0.09s user 0.02s system 97% cpu 0.111 total\r\n```\r\nAny ideas what am I doing wrong? - I'm using thread 0.2.0"},"comment":{"url":"https://api.github.com/repos/meh/ruby-thread/issues/comments/103143313","html_url":"https://github.com/meh/ruby-thread/issues/38#issuecomment-103143313","issue_url":"https://api.github.com/repos/meh/ruby-thread/issues/38","id":103143313,"user":{"login":"meh","id":40204,"avatar_url":"https://avatars.githubusercontent.com/u/40204?v=3","gravatar_id":"","url":"https://api.github.com/users/meh","html_url":"https://github.com/meh","followers_url":"https://api.github.com/users/meh/followers","following_url":"https://api.github.com/users/meh/following{/other_user}","gists_url":"https://api.github.com/users/meh/gists{/gist_id}","starred_url":"https://api.github.com/users/meh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meh/subscriptions","organizations_url":"https://api.github.com/users/meh/orgs","repos_url":"https://api.github.com/users/meh/repos","events_url":"https://api.github.com/users/meh/events{/privacy}","received_events_url":"https://api.github.com/users/meh/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T17:33:18Z","updated_at":"2015-05-18T17:33:18Z","body":"With `Thread::Pool.abort_on_exception = true`."}}