{"action":"created","issue":{"url":"https://api.github.com/repos/fruux/sabre-event/issues/42","repository_url":"https://api.github.com/repos/fruux/sabre-event","labels_url":"https://api.github.com/repos/fruux/sabre-event/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/fruux/sabre-event/issues/42/comments","events_url":"https://api.github.com/repos/fruux/sabre-event/issues/42/events","html_url":"https://github.com/fruux/sabre-event/issues/42","id":182150440,"number":42,"title":"Coroutines should resolve with the generator return value","user":{"login":"felixfbecker","id":10532611,"avatar_url":"https://avatars.githubusercontent.com/u/10532611?v=3","gravatar_id":"","url":"https://api.github.com/users/felixfbecker","html_url":"https://github.com/felixfbecker","followers_url":"https://api.github.com/users/felixfbecker/followers","following_url":"https://api.github.com/users/felixfbecker/following{/other_user}","gists_url":"https://api.github.com/users/felixfbecker/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfbecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfbecker/subscriptions","organizations_url":"https://api.github.com/users/felixfbecker/orgs","repos_url":"https://api.github.com/users/felixfbecker/repos","events_url":"https://api.github.com/users/felixfbecker/events{/privacy}","received_events_url":"https://api.github.com/users/felixfbecker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fruux/sabre-event/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-10-11T01:09:35Z","updated_at":"2016-10-23T19:27:06Z","closed_at":"2016-10-13T17:54:42Z","body":"PHP 7 has `Generator::getReturn()` to get the return value of a generator. That means code like this is possible:\r\n```php\r\ncoroutine(function () {\r\n  $x = yield someAsync();\r\n  if ($x->whatever) {\r\n    return 'thisvalue';\r\n  }\r\n  $y = yield someOtherAsync();\r\n  if ($y->whatever) {\r\n    return 'thatvalue';\r\n  }\r\n  return yield $y->whatelse();\r\n```\r\nBut currently coroutines will always use the last `yield` value, which makes control flow like above weird."},"comment":{"url":"https://api.github.com/repos/fruux/sabre-event/issues/comments/255608602","html_url":"https://github.com/fruux/sabre-event/issues/42#issuecomment-255608602","issue_url":"https://api.github.com/repos/fruux/sabre-event/issues/42","id":255608602,"user":{"login":"evert","id":178960,"avatar_url":"https://avatars.githubusercontent.com/u/178960?v=3","gravatar_id":"","url":"https://api.github.com/users/evert","html_url":"https://github.com/evert","followers_url":"https://api.github.com/users/evert/followers","following_url":"https://api.github.com/users/evert/following{/other_user}","gists_url":"https://api.github.com/users/evert/gists{/gist_id}","starred_url":"https://api.github.com/users/evert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evert/subscriptions","organizations_url":"https://api.github.com/users/evert/orgs","repos_url":"https://api.github.com/users/evert/repos","events_url":"https://api.github.com/users/evert/events{/privacy}","received_events_url":"https://api.github.com/users/evert/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T19:27:06Z","updated_at":"2016-10-23T19:27:06Z","body":"Just released it!"}}
{"actor":{"display_login":"evert"}}