Reputation: 737
I have a web app on Ruby on rails with more than 20 million records and counting in a Postgres database. I have a page/controller that does some big time operations with this data so the user is waiting for more time that I would like.
Is there any way I can return data in blocks of info? I mean, I imagine the user seeing the first 10 rows and waiting for the next ones with a percentage bar that informs him how much is done (10% data returned for ex.)
I guess that with multiple ajax/json calls this could be done but I'm trying to avoid multiple calls.
More: Are websockets really a choice here?
By the way, I'm using Rails 3.2
Upvotes: 1
Views: 38
Reputation: 176552
You can use the ActiveController::Streaming
feature.
See also
Upvotes: 1