You could log the output you wish to display. I think this would be
the best way if using a remote site.

But, if it's a local process and of limited use printing to the
console is ok. I wrote a rails program to track my local IP address as
it would change at random intervals and have the process print the
current IP out to a terminal.


On Jan 18, 7:23 pm, David Kahn <d...@structuralartistry.com> wrote:
> I have a long running process for an internal Rails 3 app. In a certain case
> I iterate over and process thousands + records which takes awhile. I want to
> output something like the detail of which record is being processed out to
> the user, to show that the process is in progress and not hung. This app is
> not about not keeping the user from waiting but to keep them in the loop,
> excuse the pun.
>
> So for example I have an array.each method which is handling these many
> records. Anyone have an idea how I could send messages out of this loop
> while it is in progress? If I was just writing a console app I would use
> 'puts' or 'print'... so that I would see these messages in real time on the
> console. Any way to do anything similar on the web? I know on the ui side I
> would have to do some ajax in a loop to get the updates. Thinking aloud, I
> could have this method output to a db table which the ajax could query...
> kind of yucky.
>
> Just curious if there would be any easy way to do this before I resort to a
> simple spinner.
>
> Thanks,
>
> David

-- 
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-talk@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