« Return to Thread: Anyone else using Groovy?

Re: actions that take long time

by Leonard Gestrin :: Rate this Message:

Reply to Author | View in Thread

That would cause the browser to always go to wait_page even if
processing takes less than acceptable wait time, which is not desirable.

We also ended up storing original request's attributes and setting them
back once action is processed for the next forward and the way we tied
running thread to user  via it's http session, so it would be possible
to lookup running task once wait page comes back. Wait page could be
customized for different actions with timeout delays, messages, progress
bar, etc. (by having baseDelayedAction every action had it for free but
could overwrite).

If all this complexity can be hidden in annotation, it might work;
otherwise it might need to be done on the Dispatcher level.

In struts, everything was going through 'perform' or 'execute' method,
so it was easy to intercept calls and put them in threads. In case of
Stripes, dispatcher calls actionbeans directly. I think it would fall
into Dispatcher responsibility to figure out if this ongoing task
(thread containing action needs to be retrieved status checked, and
appropriate action performed).

I think it would be very nice addition to stripes framework. I don't
know of any framework that has this feature of the box.
-----Original Message-----
From: stripes-users-bounces@...
[mailto:stripes-users-bounces@...] On Behalf Of Aaron
Porter
Sent: Thursday, January 24, 2008 4:09 PM
To: stripes-users@...
Subject: Re: [Stripes-users] actions that take long time

Nothing exists now but that does sound like an interesting idea and
Stripe's Resolutions could make
it work really well. It would probably be an annotation on the
ActionBean's event method, maybe
@DelayedAction("/your_wait_page.jsp"). When the event was going to be
invoked it would spawn a new
thread to do the processing and do a forward to the wait page. The wait
page could use JavaScript to
check if the processing was complete or fallback to a <meta
http-equiv="refresh" content="2"> inside
of a <noscript>.

I'll have to play around with that idea!

Aaron

Leonard Gestrin wrote:
> Hello,
> I was wondering if anything in Stripes exists to support
time-consuming

> operation. Let's say, user hits an action that might take considerable
> amount of time. In such cases, application should probably display
> progress bar, spinner or something to tell user that operation is in
> progress. It would be nice if it could show progress status and allow
> user to cancel.
>
> it appears that this could probably be done with custom dispatcher
> servlet, which would spawn new thread for every action that implements
> certain interface (DelayedAction for example), so that servlet would
> check on the
> status and send back to the browser special page that would check back
> after some time with a servlet.  We've done something like with
Strut's
> actions and it worked pretty well.
>
> It sounds like pretty common problem that people should face. It would
> be interesting to know what people think - if it is reasonable
approach

> and how other folks solving this issue.
>
> Thanks
> Leonard
>
>
>
>
>
>
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users

 « Return to Thread: Anyone else using Groovy?