{"action":"created","issue":{"url":"https://api.github.com/repos/celluloid/celluloid/issues/487","labels_url":"https://api.github.com/repos/celluloid/celluloid/issues/487/labels{/name}","comments_url":"https://api.github.com/repos/celluloid/celluloid/issues/487/comments","events_url":"https://api.github.com/repos/celluloid/celluloid/issues/487/events","html_url":"https://github.com/celluloid/celluloid/issues/487","id":53309231,"number":487,"title":"Question: SupervisionGroup doesn't prevent main thread finishing","user":{"login":"Integralist","id":180050,"avatar_url":"https://avatars.githubusercontent.com/u/180050?v=3","gravatar_id":"","url":"https://api.github.com/users/Integralist","html_url":"https://github.com/Integralist","followers_url":"https://api.github.com/users/Integralist/followers","following_url":"https://api.github.com/users/Integralist/following{/other_user}","gists_url":"https://api.github.com/users/Integralist/gists{/gist_id}","starred_url":"https://api.github.com/users/Integralist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Integralist/subscriptions","organizations_url":"https://api.github.com/users/Integralist/orgs","repos_url":"https://api.github.com/users/Integralist/repos","events_url":"https://api.github.com/users/Integralist/events{/privacy}","received_events_url":"https://api.github.com/users/Integralist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-03T17:04:06Z","updated_at":"2015-03-13T16:41:57Z","closed_at":null,"body":"I'm using the following example code (taken from https://github.com/celluloid/celluloid/wiki/Supervision%20Groups):\r\n\r\n```ruby\r\nrequire \"celluloid\"\r\n\r\nclass Person\r\n  include Celluloid\r\n\r\n  def initialize(age, height, weight)\r\n    p(age: age, height: height, weight: weight)\r\n  end\r\n\r\n  def bar\r\n    rand(20)\r\n  end\r\nend\r\n\r\nsupervisor = Celluloid::SupervisionGroup.run!\r\nsupervisor.pool(Person, as: :people, args: [1,2,3], size: 3)\r\n\r\np \"Size: #{Celluloid::Actor.all.size}\"\r\n\r\n2.times do\r\n  p supervisor[:people].bar\r\nend\r\n```\r\n\r\nIf I don't include a `sleep` at the bottom of the file then the pool of Actors will all terminate.\r\n\r\nI was under the impression that using a Supervision group would mean I wouldn't need to use `sleep` (i.e. https://github.com/celluloid/celluloid/wiki/Frequently-Asked-Questions#q-my-program-written-with-celluloid-just-exits-when-i-run-it-what-gives)"},"comment":{"url":"https://api.github.com/repos/celluloid/celluloid/issues/comments/79116084","html_url":"https://github.com/celluloid/celluloid/issues/487#issuecomment-79116084","issue_url":"https://api.github.com/repos/celluloid/celluloid/issues/487","id":79116084,"user":{"login":"michal-kocarek","id":762095,"avatar_url":"https://avatars.githubusercontent.com/u/762095?v=3","gravatar_id":"","url":"https://api.github.com/users/michal-kocarek","html_url":"https://github.com/michal-kocarek","followers_url":"https://api.github.com/users/michal-kocarek/followers","following_url":"https://api.github.com/users/michal-kocarek/following{/other_user}","gists_url":"https://api.github.com/users/michal-kocarek/gists{/gist_id}","starred_url":"https://api.github.com/users/michal-kocarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michal-kocarek/subscriptions","organizations_url":"https://api.github.com/users/michal-kocarek/orgs","repos_url":"https://api.github.com/users/michal-kocarek/repos","events_url":"https://api.github.com/users/michal-kocarek/events{/privacy}","received_events_url":"https://api.github.com/users/michal-kocarek/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T16:41:57Z","updated_at":"2015-03-13T16:41:57Z","body":"Well that does not help. When I want to create the supervision group dynamically, I need to call .pool, .supervise, .supervise_as on existing supervision group which I cannot create with .run as it prevents call.\r\n\r\nIs there any solution for that?\r\n\r\nAlso, this counts only with one supervision group, let's say I want to have two of them in the main thread, and wait for both of them to finish."}}