multi = EventMachine::Synchrony::Multi.new
(1..2).each do |id|
multi.add id, DB.aquery("select #{id}")
end
results = []
perform_response = multi.perform
perform_response.responses[:callback].each do |res|
res.last.callback{|r| results << r.first}
end
[200, {'Content-Type' => 'application/json; charset=utf-8'}, results]
And the error message is this:
This connection is still waiting for a result, try again once you have the result (Mysql2::Error)
I know I must be doing something wrong but I'm not sure what it is. I'm hoping someone can point in me in the right direction.
Thanks