{"action":"created","issue":{"url":"https://api.github.com/repos/koajs/koa/issues/581","labels_url":"https://api.github.com/repos/koajs/koa/issues/581/labels{/name}","comments_url":"https://api.github.com/repos/koajs/koa/issues/581/comments","events_url":"https://api.github.com/repos/koajs/koa/issues/581/events","html_url":"https://github.com/koajs/koa/issues/581","id":114453348,"number":581,"title":"Best practice for async with Koa 2.0","user":{"login":"derek-duncan","id":2983822,"avatar_url":"https://avatars.githubusercontent.com/u/2983822?v=3","gravatar_id":"","url":"https://api.github.com/users/derek-duncan","html_url":"https://github.com/derek-duncan","followers_url":"https://api.github.com/users/derek-duncan/followers","following_url":"https://api.github.com/users/derek-duncan/following{/other_user}","gists_url":"https://api.github.com/users/derek-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/derek-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derek-duncan/subscriptions","organizations_url":"https://api.github.com/users/derek-duncan/orgs","repos_url":"https://api.github.com/users/derek-duncan/repos","events_url":"https://api.github.com/users/derek-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/derek-duncan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-11-01T06:11:17Z","updated_at":"2015-11-03T20:12:01Z","closed_at":null,"body":"First off, Koa 2.0 –> great work! I've been playing with it today and have really appreciated the focus on modularity and the future of js.\r\n\r\nIn light of this new release, what's the most preferred/best practice for handling *asynchronous operations*? In previous iterations of Koa, generators have been exclusively used to provide handle async and avoid callback hell. With this new release, generator support has been completely dropped in preference of async functions, which rely heavily on Promises.\r\n\r\nAnyways, I'm often posed with the challenge of choosing one of the above options to handle asynchronous operations. However, I want to generally keep my choice consistent across a codebase since generators and async functions seem to not work fluently together. Also, as a personal preference, I'd like to avoid wrapping so many functions/modules in a helper function (like `koa-convert`) in lieu of forcing these various options to work together. Thus, I just wanted to hear the Koa community's thoughts on the matter before I go dive into an unconventional direction. "},"comment":{"url":"https://api.github.com/repos/koajs/koa/issues/comments/153473458","html_url":"https://github.com/koajs/koa/issues/581#issuecomment-153473458","issue_url":"https://api.github.com/repos/koajs/koa/issues/581","id":153473458,"user":{"login":"tejasmanohar","id":5959235,"avatar_url":"https://avatars.githubusercontent.com/u/5959235?v=3","gravatar_id":"","url":"https://api.github.com/users/tejasmanohar","html_url":"https://github.com/tejasmanohar","followers_url":"https://api.github.com/users/tejasmanohar/followers","following_url":"https://api.github.com/users/tejasmanohar/following{/other_user}","gists_url":"https://api.github.com/users/tejasmanohar/gists{/gist_id}","starred_url":"https://api.github.com/users/tejasmanohar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejasmanohar/subscriptions","organizations_url":"https://api.github.com/users/tejasmanohar/orgs","repos_url":"https://api.github.com/users/tejasmanohar/repos","events_url":"https://api.github.com/users/tejasmanohar/events{/privacy}","received_events_url":"https://api.github.com/users/tejasmanohar/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T20:12:00Z","updated_at":"2015-11-03T20:12:00Z","body":"Right, I still think it's better than callbacks."}}