{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3298","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3298/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3298/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3298/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3298","id":47928620,"number":3298,"title":"Reading from multiple changefeeds in Python","user":{"login":"AtnNn","id":706854,"avatar_url":"https://avatars.githubusercontent.com/u/706854?v=3","gravatar_id":"","url":"https://api.github.com/users/AtnNn","html_url":"https://github.com/AtnNn","followers_url":"https://api.github.com/users/AtnNn/followers","following_url":"https://api.github.com/users/AtnNn/following{/other_user}","gists_url":"https://api.github.com/users/AtnNn/gists{/gist_id}","starred_url":"https://api.github.com/users/AtnNn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtnNn/subscriptions","organizations_url":"https://api.github.com/users/AtnNn/orgs","repos_url":"https://api.github.com/users/AtnNn/repos","events_url":"https://api.github.com/users/AtnNn/events{/privacy}","received_events_url":"https://api.github.com/users/AtnNn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:RQL_proposal","name":"tp:RQL_proposal","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/89","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/89/labels","id":950901,"number":89,"title":"2.0","description":"","creator":{"login":"danielmewes","id":505365,"avatar_url":"https://avatars.githubusercontent.com/u/505365?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmewes","html_url":"https://github.com/danielmewes","followers_url":"https://api.github.com/users/danielmewes/followers","following_url":"https://api.github.com/users/danielmewes/following{/other_user}","gists_url":"https://api.github.com/users/danielmewes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmewes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmewes/subscriptions","organizations_url":"https://api.github.com/users/danielmewes/orgs","repos_url":"https://api.github.com/users/danielmewes/repos","events_url":"https://api.github.com/users/danielmewes/events{/privacy}","received_events_url":"https://api.github.com/users/danielmewes/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":0,"state":"open","created_at":"2015-01-26T07:45:17Z","updated_at":"2015-01-30T01:34:55Z","due_on":null,"closed_at":null},"comments":63,"created_at":"2014-11-06T06:38:11Z","updated_at":"2015-01-30T02:41:51Z","closed_at":null,"body":"The `next` operation in Python on cursors is a blocking operation, making it impossible to read from multiple changefeeds at once. This makes it very hard to take full advantage of changefeeds in Python."},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/72145002","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3298#issuecomment-72145002","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3298","id":72145002,"user":{"login":"gchpaco","id":17789,"avatar_url":"https://avatars.githubusercontent.com/u/17789?v=3","gravatar_id":"","url":"https://api.github.com/users/gchpaco","html_url":"https://github.com/gchpaco","followers_url":"https://api.github.com/users/gchpaco/followers","following_url":"https://api.github.com/users/gchpaco/following{/other_user}","gists_url":"https://api.github.com/users/gchpaco/gists{/gist_id}","starred_url":"https://api.github.com/users/gchpaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchpaco/subscriptions","organizations_url":"https://api.github.com/users/gchpaco/orgs","repos_url":"https://api.github.com/users/gchpaco/repos","events_url":"https://api.github.com/users/gchpaco/events{/privacy}","received_events_url":"https://api.github.com/users/gchpaco/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T02:41:51Z","updated_at":"2015-01-30T02:41:51Z","body":"At a guess, `net.Connection` would need to have a parameter in the constructor specifying an `asyncio.BaseEventLoop` (may be better to have a separate subclass for this, actually) which would then use `asyncio.open_connection` instead of `socket.create_connection`; after that we would need to hook up `net.Cursor` to an event loop (again, probably best done as a separate subclass).  Um, `net.Connection._sock_recvall` and `net.Connection._sock_sendall` would need to be evented, which is probably mostly using the asyncio Stream interface.  There's a trick with writing on those that goes\r\n```python\r\nw.write(data)\r\nyield from w.drain()\r\n```\r\n(or `yield From(w.drain())` in Trollius) but that's not a big deal.\r\n\r\nBasically we would need to rebase our thing on top of `asyncio` which is deliberately not super difficult."}}