{"action":"opened","issue":{"url":"https://api.github.com/repos/concurrent-php/ext-async/issues/52","repository_url":"https://api.github.com/repos/concurrent-php/ext-async","labels_url":"https://api.github.com/repos/concurrent-php/ext-async/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/concurrent-php/ext-async/issues/52/comments","events_url":"https://api.github.com/repos/concurrent-php/ext-async/issues/52/events","html_url":"https://github.com/concurrent-php/ext-async/issues/52","id":344990261,"node_id":"MDU6SXNzdWUzNDQ5OTAyNjE=","number":52,"title":"Executing Task::async immediately","user":{"login":"kelunik","id":2743004,"node_id":"MDQ6VXNlcjI3NDMwMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2743004?v=4","gravatar_id":"","url":"https://api.github.com/users/kelunik","html_url":"https://github.com/kelunik","followers_url":"https://api.github.com/users/kelunik/followers","following_url":"https://api.github.com/users/kelunik/following{/other_user}","gists_url":"https://api.github.com/users/kelunik/gists{/gist_id}","starred_url":"https://api.github.com/users/kelunik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelunik/subscriptions","organizations_url":"https://api.github.com/users/kelunik/orgs","repos_url":"https://api.github.com/users/kelunik/repos","events_url":"https://api.github.com/users/kelunik/events{/privacy}","received_events_url":"https://api.github.com/users/kelunik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-26T20:17:23Z","updated_at":"2018-07-26T20:17:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Executing `Task::async` in a `defer` watcher causes several problems making code harder to write, e.g.\r\n\r\n```\r\nTask::async([$this, 'write'], \"foo\");\r\n$this->write(\"bar\");\r\n```\r\n\r\nwill first write `\"foo\"` then `\"bar\"`. Another example:\r\n\r\n```\r\n/** @inheritdoc */\r\npublic function end(string $data = \"\"): Promise\r\n{\r\n    // TODO: Set writable directly to false here\r\n    $this->write($data);\r\n    $this->writable = false;\r\n    $this->close();\r\n}\r\n```"}}
{"actor":{"display_login":"kelunik"}}