{"action":"created","issue":{"url":"https://api.github.com/repos/FSX/momoko/issues/94","labels_url":"https://api.github.com/repos/FSX/momoko/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/FSX/momoko/issues/94/comments","events_url":"https://api.github.com/repos/FSX/momoko/issues/94/events","html_url":"https://github.com/FSX/momoko/issues/94","id":55424807,"number":94,"title":"Switch to Future based interface?","user":{"login":"davidblewett","id":141716,"avatar_url":"https://avatars.githubusercontent.com/u/141716?v=3","gravatar_id":"","url":"https://api.github.com/users/davidblewett","html_url":"https://github.com/davidblewett","followers_url":"https://api.github.com/users/davidblewett/followers","following_url":"https://api.github.com/users/davidblewett/following{/other_user}","gists_url":"https://api.github.com/users/davidblewett/gists{/gist_id}","starred_url":"https://api.github.com/users/davidblewett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidblewett/subscriptions","organizations_url":"https://api.github.com/users/davidblewett/orgs","repos_url":"https://api.github.com/users/davidblewett/repos","events_url":"https://api.github.com/users/davidblewett/events{/privacy}","received_events_url":"https://api.github.com/users/davidblewett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-25T18:46:39Z","updated_at":"2015-01-26T07:12:29Z","closed_at":null,"body":"I am really interested in this project, but I think the current implementation could be drastically simplified if you switched to Tornado's coroutine / Future system ( http://tornado.readthedocs.org/en/latest/guide/coroutines.html ) rather than the callback interface that is currently implemented. This would mean someone using Momoko could do:\r\n\r\n```python\r\n  @gen.coroutine\r\n  def foo():\r\n      result = yield connection.execute()\r\n```\r\n\r\nInstead of the current Connection class attaching a callback on operations, an IOStream would need to be implemented I think: http://tornado.readthedocs.org/en/latest/iostream.html .\r\n\r\n\r\n\r\nDoing things this way means that standard exception handling works, which could simplify the current implementation significantly. I can take a look at implementing this at some point; just wanted to jot some ideas down while I had time."},"comment":{"url":"https://api.github.com/repos/FSX/momoko/issues/comments/71421631","html_url":"https://github.com/FSX/momoko/issues/94#issuecomment-71421631","issue_url":"https://api.github.com/repos/FSX/momoko/issues/94","id":71421631,"user":{"login":"haizaar","id":58201,"avatar_url":"https://avatars.githubusercontent.com/u/58201?v=3","gravatar_id":"","url":"https://api.github.com/users/haizaar","html_url":"https://github.com/haizaar","followers_url":"https://api.github.com/users/haizaar/followers","following_url":"https://api.github.com/users/haizaar/following{/other_user}","gists_url":"https://api.github.com/users/haizaar/gists{/gist_id}","starred_url":"https://api.github.com/users/haizaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haizaar/subscriptions","organizations_url":"https://api.github.com/users/haizaar/orgs","repos_url":"https://api.github.com/users/haizaar/repos","events_url":"https://api.github.com/users/haizaar/events{/privacy}","received_events_url":"https://api.github.com/users/haizaar/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T07:12:29Z","updated_at":"2015-01-26T07:12:29Z","body":"Apparently I was thinking about that quite a while. Its a logical thing to do. But its a still low priority for me until Tornado start to deprecate their old interface.\r\n\r\nBut I'll be happy to review your pull requests.\r\n"}}