On Wed, Apr 17, 2013 at 4:43 PM, George Christman
<gchrist...@cardaddy.com>wrote:

> Cezary, I would agree with your response if it didn't work perfectly fine
> in my test page using the same proxy settings. Anyhow, I removed the proxy
> all together and the behavior remains the same. Do you have any suggestions
> in regards to debugging this issue?
>
> I also agree this should be put on it's own thread, I'm just not aware of
> away with tapestry to push the response back to the UI after the thread has
> completed.
>

You would push response back as you would do with any other web framework :)
There are two options -- poll or push. You can push from server to
client-size using CometD or WebSockets,
or you can poll from client side and check if results are ready on server.
For instance, you may store results to DB when your job completed and
lookup results from DB on poll requests.

You can use ZoneRefresh, or just do AJAX call, say, with jQuery and return
results in response to display them on client-side using tapestry
client-side API or your custom javascript.


> On Tue, Apr 16, 2013 at 4:21 PM, Cezary Biernacki <cezary...@gmail.com
> >wrote:
>
> > Hi George,
> > you answered your own question.  Your proxy waits for response and after
> > some time it fails the request and issues new one. It is a typical
> > behaviour of the proxy, and it is designed to recover from failures or
> > temporary unresponsive servers. Check documentation of your proxy to see
> > how to change default timeout value. However setting this too high is
> not a
> > good solution. Browser also implement some maximum wait time (AFAIK
> around
> > 6 minutes). Even without software timeouts after few minutes a user
> > probably will get impatient and click refresh thinking that connection
> > failed.
> >
> > The proper solution would be to start long running process on a separate
> > thread (e.g. by using ParallelExecutor) or maybe even a separate machine,
> > return request immediately and provide some kind of feedback (e.g. via
> AJAX
> > polling) about process progress.
> >
> > Best regards,
> > Cezary
> >
> >
> > On Tue, 16 Apr 2013 14:08:14 -0400 George Christman <
> > gchrist...@cardaddy.com> wrote:
> >
> >> I ended up setting up a test app to learn that the issue was on my end
> >> and that the test app worked as intended. I setup Charlies Proxy and
> >> discovered after 30.0 seconds exact, it fails the request and creates
> >> a new request. I've disabled all my JS, css and can not figure out the
> >> underlying issue. Does anybody happen to know what might be happening?
> >>
> >> On Mon, Apr 15, 2013 at 7:56 PM, Cezary Biernacki <cezary...@gmail.com>
> >> wrote:
> >>
> >>> Are you sure that the second request is not generated by e.g. a reverse
> >>> proxy?
> >>>
> >>>
> >>> On Mon, Apr 15, 2013 at 7:59 PM, George Christman
> >>> <gchrist...@cardaddy.com>**wrote:
> >>>
> >>>  Hello, I have a long running process in my onSuccess method. I'm
> >>>> noticing my onActivate and onValidate methods are being called
> >>>> multiple times before the onSuccess method has actually completed. I
> >>>> was able to successfully reproduce this using Thread.sleep in the
> >>>> following example. Does anybody know why this my be happening?
> >>>>
> >>>> onActivate() {
> >>>>     System.out.println("**onActivate");
> >>>> }
> >>>>
> >>>> onValidate() {
> >>>>     System.out.println("**onValidate");
> >>>> }
> >>>>
> >>>> Object onSuccess() throws Exception {
> >>>>          if(ApplicationActionEnum.**GENERATE_PO == this.action) {
> >>>>              try {
> >>>>                  Thread.sleep(60000);
> >>>>              } catch (Exception e) {
> >>>>
> >>>>              }
> >>>>          }
> >>>>          System.out.println("onSuccess"**);
> >>>>          return Index.class;
> >>>>      }
> >>>>
> >>>> My output.
> >>>>
> >>>> onActivate
> >>>> pnValidate
> >>>> onActivate
> >>>> pnValidate
> >>>> OnSuccess
> >>>>
> >>>> ------------------------------**------------------------------**
> >>>> ---------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> >>>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>>
> >>>>
> >>>>
> >>
> >>
> >
> >
> > ------------------------------**------------------------------**---------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Reply via email to