{"action":"opened","number":491,"pull_request":{"url":"https://api.github.com/repos/celluloid/celluloid/pulls/491","id":27835283,"html_url":"https://github.com/celluloid/celluloid/pull/491","diff_url":"https://github.com/celluloid/celluloid/pull/491.diff","patch_url":"https://github.com/celluloid/celluloid/pull/491.patch","issue_url":"https://api.github.com/repos/celluloid/celluloid/issues/491","number":491,"state":"open","locked":false,"title":"Timeout extensions","user":{"login":"TiagoCardoso1983","id":215707,"avatar_url":"https://avatars.githubusercontent.com/u/215707?v=3","gravatar_id":"","url":"https://api.github.com/users/TiagoCardoso1983","html_url":"https://github.com/TiagoCardoso1983","followers_url":"https://api.github.com/users/TiagoCardoso1983/followers","following_url":"https://api.github.com/users/TiagoCardoso1983/following{/other_user}","gists_url":"https://api.github.com/users/TiagoCardoso1983/gists{/gist_id}","starred_url":"https://api.github.com/users/TiagoCardoso1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiagoCardoso1983/subscriptions","organizations_url":"https://api.github.com/users/TiagoCardoso1983/orgs","repos_url":"https://api.github.com/users/TiagoCardoso1983/repos","events_url":"https://api.github.com/users/TiagoCardoso1983/events{/privacy}","received_events_url":"https://api.github.com/users/TiagoCardoso1983/received_events","type":"User","site_admin":false},"body":"Continuation of what's going on [here](https://github.com/celluloid/timeout/pull/1#issuecomment-70564139). This is how I envisioned integrating the extensions into celluloid. Main changes are a few Exceptions, method signatures and the fact that the main timeout and sleep logic is directly inside the Celluloid module, instead of inside the actor.\r\n\r\nMain discussion topics:\r\n\r\n1. I think that the Actor should drop the timeout and sleep instance methods. I mean, they should be using timeout and sleep directly, which will revert to the handlers inside its thread. This will not be a breaking change for the ones who have been using timeout and sleep inside the actor scope as if they were a private method, but it would break such usages as `Thread.current[:celluloid_actor].timeout(duration)...:` \r\n2. I think that one should drop Celluloid::Task::TimeoutError in favour of Timeout::Error. I mean, one should use the same exceptions as other potential libraries expect (Net::SSH, Net::HTTP, etc, they all work with it). I think one did it because of the ResumableError class, but since this has become a module, one could \"extend\" the Timeout::Error instance before resuming the task (see how this was solved under Celluloid.timeout).\r\n3. A somewhat elephant in the room is Celluloid.sleep argument handling. I couldn't really mimic the Kernel.sleep method signature, as you can call sleep without arguments. The question here is, should one allow celluloid actors to sleep forever? Does the timers gem support this feature? Do you think this is a relevant use-case? I think one should at least throw a relevant exception for the case in which no argument is passed to a sleep evaluated inside an actor.\r\n\r\n","created_at":"2015-01-22T11:26:46Z","updated_at":"2015-01-22T11:26:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/celluloid/celluloid/pulls/491/commits","review_comments_url":"https://api.github.com/repos/celluloid/celluloid/pulls/491/comments","review_comment_url":"https://api.github.com/repos/celluloid/celluloid/pulls/comments/{number}","comments_url":"https://api.github.com/repos/celluloid/celluloid/issues/491/comments","statuses_url":"https://api.github.com/repos/celluloid/celluloid/statuses/0652caca0d7f86307365ee2f98855233b4f80b25","head":{"label":"TiagoCardoso1983:timeout_extensions","ref":"timeout_extensions","sha":"0652caca0d7f86307365ee2f98855233b4f80b25","user":{"login":"TiagoCardoso1983","id":215707,"avatar_url":"https://avatars.githubusercontent.com/u/215707?v=3","gravatar_id":"","url":"https://api.github.com/users/TiagoCardoso1983","html_url":"https://github.com/TiagoCardoso1983","followers_url":"https://api.github.com/users/TiagoCardoso1983/followers","following_url":"https://api.github.com/users/TiagoCardoso1983/following{/other_user}","gists_url":"https://api.github.com/users/TiagoCardoso1983/gists{/gist_id}","starred_url":"https://api.github.com/users/TiagoCardoso1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiagoCardoso1983/subscriptions","organizations_url":"https://api.github.com/users/TiagoCardoso1983/orgs","repos_url":"https://api.github.com/users/TiagoCardoso1983/repos","events_url":"https://api.github.com/users/TiagoCardoso1983/events{/privacy}","received_events_url":"https://api.github.com/users/TiagoCardoso1983/received_events","type":"User","site_admin":false},"repo":{"id":16508454,"name":"celluloid","full_name":"TiagoCardoso1983/celluloid","owner":{"login":"TiagoCardoso1983","id":215707,"avatar_url":"https://avatars.githubusercontent.com/u/215707?v=3","gravatar_id":"","url":"https://api.github.com/users/TiagoCardoso1983","html_url":"https://github.com/TiagoCardoso1983","followers_url":"https://api.github.com/users/TiagoCardoso1983/followers","following_url":"https://api.github.com/users/TiagoCardoso1983/following{/other_user}","gists_url":"https://api.github.com/users/TiagoCardoso1983/gists{/gist_id}","starred_url":"https://api.github.com/users/TiagoCardoso1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiagoCardoso1983/subscriptions","organizations_url":"https://api.github.com/users/TiagoCardoso1983/orgs","repos_url":"https://api.github.com/users/TiagoCardoso1983/repos","events_url":"https://api.github.com/users/TiagoCardoso1983/events{/privacy}","received_events_url":"https://api.github.com/users/TiagoCardoso1983/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TiagoCardoso1983/celluloid","description":"Actor-based concurrent object framework for Ruby","fork":true,"url":"https://api.github.com/repos/TiagoCardoso1983/celluloid","forks_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/forks","keys_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/teams","hooks_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/hooks","issue_events_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/issues/events{/number}","events_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/events","assignees_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/assignees{/user}","branches_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/branches{/branch}","tags_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/tags","blobs_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/git/refs{/sha}","trees_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/statuses/{sha}","languages_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/languages","stargazers_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/stargazers","contributors_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/contributors","subscribers_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/subscribers","subscription_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/subscription","commits_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/commits{/sha}","git_commits_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/git/commits{/sha}","comments_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/comments{/number}","issue_comment_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/issues/comments/{number}","contents_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/contents/{+path}","compare_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/merges","archive_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/downloads","issues_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/issues{/number}","pulls_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/pulls{/number}","milestones_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/milestones{/number}","notifications_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/labels{/name}","releases_url":"https://api.github.com/repos/TiagoCardoso1983/celluloid/releases{/id}","created_at":"2014-02-04T10:19:19Z","updated_at":"2014-02-04T12:15:48Z","pushed_at":"2015-01-22T11:14:51Z","git_url":"git://github.com/TiagoCardoso1983/celluloid.git","ssh_url":"git@github.com:TiagoCardoso1983/celluloid.git","clone_url":"https://github.com/TiagoCardoso1983/celluloid.git","svn_url":"https://github.com/TiagoCardoso1983/celluloid","homepage":"http://celluloid.io","size":1926,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"celluloid:master","ref":"master","sha":"6a5c9cd5791306e6c09afbb9be1e8a2d5512204d","user":{"login":"celluloid","id":1292091,"avatar_url":"https://avatars.githubusercontent.com/u/1292091?v=3","gravatar_id":"","url":"https://api.github.com/users/celluloid","html_url":"https://github.com/celluloid","followers_url":"https://api.github.com/users/celluloid/followers","following_url":"https://api.github.com/users/celluloid/following{/other_user}","gists_url":"https://api.github.com/users/celluloid/gists{/gist_id}","starred_url":"https://api.github.com/users/celluloid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/celluloid/subscriptions","organizations_url":"https://api.github.com/users/celluloid/orgs","repos_url":"https://api.github.com/users/celluloid/repos","events_url":"https://api.github.com/users/celluloid/events{/privacy}","received_events_url":"https://api.github.com/users/celluloid/received_events","type":"Organization","site_admin":false},"repo":{"id":1549395,"name":"celluloid","full_name":"celluloid/celluloid","owner":{"login":"celluloid","id":1292091,"avatar_url":"https://avatars.githubusercontent.com/u/1292091?v=3","gravatar_id":"","url":"https://api.github.com/users/celluloid","html_url":"https://github.com/celluloid","followers_url":"https://api.github.com/users/celluloid/followers","following_url":"https://api.github.com/users/celluloid/following{/other_user}","gists_url":"https://api.github.com/users/celluloid/gists{/gist_id}","starred_url":"https://api.github.com/users/celluloid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/celluloid/subscriptions","organizations_url":"https://api.github.com/users/celluloid/orgs","repos_url":"https://api.github.com/users/celluloid/repos","events_url":"https://api.github.com/users/celluloid/events{/privacy}","received_events_url":"https://api.github.com/users/celluloid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/celluloid/celluloid","description":"Actor-based concurrent object framework for Ruby","fork":false,"url":"https://api.github.com/repos/celluloid/celluloid","forks_url":"https://api.github.com/repos/celluloid/celluloid/forks","keys_url":"https://api.github.com/repos/celluloid/celluloid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/celluloid/celluloid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/celluloid/celluloid/teams","hooks_url":"https://api.github.com/repos/celluloid/celluloid/hooks","issue_events_url":"https://api.github.com/repos/celluloid/celluloid/issues/events{/number}","events_url":"https://api.github.com/repos/celluloid/celluloid/events","assignees_url":"https://api.github.com/repos/celluloid/celluloid/assignees{/user}","branches_url":"https://api.github.com/repos/celluloid/celluloid/branches{/branch}","tags_url":"https://api.github.com/repos/celluloid/celluloid/tags","blobs_url":"https://api.github.com/repos/celluloid/celluloid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/celluloid/celluloid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/celluloid/celluloid/git/refs{/sha}","trees_url":"https://api.github.com/repos/celluloid/celluloid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/celluloid/celluloid/statuses/{sha}","languages_url":"https://api.github.com/repos/celluloid/celluloid/languages","stargazers_url":"https://api.github.com/repos/celluloid/celluloid/stargazers","contributors_url":"https://api.github.com/repos/celluloid/celluloid/contributors","subscribers_url":"https://api.github.com/repos/celluloid/celluloid/subscribers","subscription_url":"https://api.github.com/repos/celluloid/celluloid/subscription","commits_url":"https://api.github.com/repos/celluloid/celluloid/commits{/sha}","git_commits_url":"https://api.github.com/repos/celluloid/celluloid/git/commits{/sha}","comments_url":"https://api.github.com/repos/celluloid/celluloid/comments{/number}","issue_comment_url":"https://api.github.com/repos/celluloid/celluloid/issues/comments/{number}","contents_url":"https://api.github.com/repos/celluloid/celluloid/contents/{+path}","compare_url":"https://api.github.com/repos/celluloid/celluloid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/celluloid/celluloid/merges","archive_url":"https://api.github.com/repos/celluloid/celluloid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/celluloid/celluloid/downloads","issues_url":"https://api.github.com/repos/celluloid/celluloid/issues{/number}","pulls_url":"https://api.github.com/repos/celluloid/celluloid/pulls{/number}","milestones_url":"https://api.github.com/repos/celluloid/celluloid/milestones{/number}","notifications_url":"https://api.github.com/repos/celluloid/celluloid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/celluloid/celluloid/labels{/name}","releases_url":"https://api.github.com/repos/celluloid/celluloid/releases{/id}","created_at":"2011-03-31T04:05:41Z","updated_at":"2015-01-22T10:47:38Z","pushed_at":"2015-01-11T03:22:38Z","git_url":"git://github.com/celluloid/celluloid.git","ssh_url":"git@github.com:celluloid/celluloid.git","clone_url":"https://github.com/celluloid/celluloid.git","svn_url":"https://github.com/celluloid/celluloid","homepage":"https://celluloid.io","size":5084,"stargazers_count":2618,"watchers_count":2618,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":196,"mirror_url":null,"open_issues_count":71,"forks":196,"open_issues":71,"watchers":2618,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/celluloid/celluloid/pulls/491"},"html":{"href":"https://github.com/celluloid/celluloid/pull/491"},"issue":{"href":"https://api.github.com/repos/celluloid/celluloid/issues/491"},"comments":{"href":"https://api.github.com/repos/celluloid/celluloid/issues/491/comments"},"review_comments":{"href":"https://api.github.com/repos/celluloid/celluloid/pulls/491/comments"},"review_comment":{"href":"https://api.github.com/repos/celluloid/celluloid/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/celluloid/celluloid/pulls/491/commits"},"statuses":{"href":"https://api.github.com/repos/celluloid/celluloid/statuses/0652caca0d7f86307365ee2f98855233b4f80b25"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":9,"additions":49,"deletions":40,"changed_files":7}}