{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3678","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3678/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3678/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3678/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3678","id":55711248,"number":3678,"title":"Reading from multiple changefeeds in Ruby","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},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/pr:high","name":"pr:high","color":"e10c02"},{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:RQL_proposal","name":"tp:RQL_proposal","color":"0052cc"}],"state":"open","locked":false,"assignee":{"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},"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":32,"closed_issues":12,"state":"open","created_at":"2015-01-26T07:45:17Z","updated_at":"2015-02-17T22:31:06Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2015-01-28T03:56:30Z","updated_at":"2015-02-19T21:43:35Z","closed_at":null,"body":"This is intended as an analog for #3298 in the context of Ruby.\r\n\r\nWe don't presently have a good story for reading from multiple changefeeds concurrently in Ruby, as in the Python case; this should get fixed before 2.0.\r\n\r\nLike in the Python case (prior to 3.4) and unlike in the JavaScript driver, Ruby does not bundle a way of doing nonblocking IO in the base language.  Unlike in the Python case, Ruby does offer [Fibers](http://www.ruby-doc.org/core-2.2.0/Fiber.html) starting in 1.9.  Fibers are cooperatively scheduled coroutines, more or less; they have small stacks reserved for them but the differences are very technical and they can be thought of as coroutines.  So we might be able to do this without using an additional library.\r\n\r\nAnother alternative is using something like [EventMachine](http://rubyeventmachine.com).  I have used EM before and it's rather scary, not the least of which because it uses its own I/O routines, entirely sidestepping Ruby; it also has the worst implementation of `popen` I have ever seen, which I swear I fixed years ago but which does not appear to have ever been accepted by upstream.  So I would prefer to use Fibers here."},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/75142921","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3678#issuecomment-75142921","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3678","id":75142921,"user":{"login":"mlucy","id":1777134,"avatar_url":"https://avatars.githubusercontent.com/u/1777134?v=3","gravatar_id":"","url":"https://api.github.com/users/mlucy","html_url":"https://github.com/mlucy","followers_url":"https://api.github.com/users/mlucy/followers","following_url":"https://api.github.com/users/mlucy/following{/other_user}","gists_url":"https://api.github.com/users/mlucy/gists{/gist_id}","starred_url":"https://api.github.com/users/mlucy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlucy/subscriptions","organizations_url":"https://api.github.com/users/mlucy/orgs","repos_url":"https://api.github.com/users/mlucy/repos","events_url":"https://api.github.com/users/mlucy/events{/privacy}","received_events_url":"https://api.github.com/users/mlucy/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T21:43:35Z","updated_at":"2015-02-19T21:43:35Z","body":"I'm basing the second one on https://github.com/eventmachine/eventmachine/wiki/Code-Snippets .  https://github.com/igrigorik/em-websocket is the only EM interface I've actually used."}}