Hi guys,

Could you recommend a common design for the following case (or point
me in the right direction):

- the user makes a request
- the server processes is it, but the process is long therefore it is
split into "chunks".
- the page is rendered with the first chunk
- when another chunk is ready, it is pushed to the client (say at the
bottom of the page or something).

I guess a solution could be:
- do the process in the background, store the chunks in a DB (marked
using session)
- get periodic AJAX calls from the client to check whether there is
"something new available" in the DB
- if there is, push to the client.

But it seems a bit heavy (and could potentially be thread unsafe?) to
me. Besides, it would be better to push the chunks as soon as they are
ready rather than waiting for periodic calls.

Is there a preferred way to do that?

Thanks a lot,
Peter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to