“row 1 is processed…”
then as row 2 is processed
“row 1 is processed…
row 2 is processed…”
Rails runs in a pretty strict request - response cycle. Each request
up an instance of Rails which constructs and returns a response. One
response per request. What you’re describing can be accomplished in a
couple of ways (at least), but unless the row processing takes a
amount of time (per row) you may not find either worth your while.
said that …
One way to handle this would be to utilize background processing via
BackgrounDRb. You’d feed it the array and query it periodically from
client to get status.
Another way would be to set up the processing so that the client
requests processing of one line, the server responds with status when
complete, the response triggers some JS function which issues a new
to the server to process the next entry in the array, etc.
BackgrounDRb is, IMHO, probably the easier way to go from a programming
perspective but, depending on your production support, you may not want
able to support distributed processing.