On Mar 29, 2011, at 7:17 AM, Hans wrote:
> Sorry but there were too many typos Here is a corrected verion
>
> I need a progress indicator that shows the progress of a parser that
> also writes the progress state to a db. I have several other examples
> of the need
> of informing the users of progress of processes that takes some time.
>
> I will not put the parser in a background process, as I think there
> should be a more simple solution, considering all the code that needs
> a background process for this solution to work i my situation with
> many progress indicators
>
> Could one use a remote ajax call to start the e.g the parser and then
> call an Ajax function
> at the onBefore call back, that asks the server about the progress as
> defined in the db
This should work, although you're possibly going to hit some problems
with server time-out on that initial request. All browsers will give
you 2 request threads at a time, some will give you more than that. So
you'd be filling your pipe with the one long-running one and the
second intermittent "polling" call. If your parsing operation can be
broken into multiple, shorter requests, then that would be the avenue
I would pursue first. Otherwise, you stand to hit some very difficult-
to-diagnose problems going down this route.
As far as how to gauge progress, what sort of data are you storing,
and can you do something lightweight like get a count of the number of
rows when you start, estimate how many rows you will add, and then do
a quick count at each status update request?
Walter
>
> Is this a possible approach?
> If so what Ajax function should be used to ask the server db about
> progress?
> Are there other better solutions?
>
> --
> 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+unsubscribe@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment