Re: generating response in different thread
Re: generating response in different thread
- Subject: Re: generating response in different thread
- From: Shehryar Khan <email@hidden>
- Date: Fri, 26 May 2006 16:06:09 -0700
Christian,
How about having the long response thread generate an http request
(curl?) to a direct action in your app to generate a response which
it then passes up to the main thread for display.
It ain't pretty but it will work.
-shehryar
On May 25, 2006, at 8:47 AM, Christian Pekeler wrote:
I have a bunch of pages that can take a long time to generate. I'd
like to show a WOLongResponsePage in the interim. The typical way
of using WOLongResponsePage is to run the business logic or
whatever is taking a long time in a different thread (kicked off by
WOLongResponsePage.performAction()), and once done, generate the
final page with the result of that expensive computation (with
WOLongResponsePage.pageForResult(Object)).
Unfortunately, the pages I have to deal with can't be used with
this pattern. They're slow because they contain thousands of
bindings which each are partly responsible for the slowness.
Getting all the values upfront at once would require me to rewrite
the pages - something I don't have time for.
So what I'd like to do instead is (simplified):
WOLongResponsePage.performAction() {
slowPage.generateResponse();
I think I've figured out how to do WOLongResponsePage.pageForResult
(the slow pages are basically display-only). My problem is calling
generateResponse() from a new thread. Some bindings on the slow
pages are hooked up to the session, and to objects in the session's
defaultEditingContext causing all sort of issues that I'm having
troubles tracking down. So, has anyone ever done this sort of thing
and could give me any advice?
Thanks,
Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ubermind.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden