• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to return Response in same context from another thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to return Response in same context from another thread?


  • Subject: Re: How to return Response in same context from another thread?
  • From: Kieran Kelleher <email@hidden>
  • Date: Fri, 24 Feb 2006 21:56:24 -0500

Thanks Chuck and Logan for the experienced tips,

Your answers confirm what I was realizing, although I had a slight hope that there was some trick like creating a dummy request using the original context to create a download response or something like that. I guess the new window strategy .... a small unobtrusive one to handle the long response for the pre-download file generation will work best for the user experience I am trying to achieve.

Regards, Kieran

On Feb 24, 2006, at 6:22 PM, email@hidden wrote:


Chuck Hill wrote on 02/24/2006 03:42:16 PM:

>
> On Feb 24, 2006, at 2:23 PM, Kieran Kelleher wrote:
>
> > Is it possible for me to generate a response back to the user in a  
> > separate thread without a matching request?
> >
> In a word, no.  That is the nature of http: request - response.
>
>
> > For example, let's say user clicks a link to download a huge file  
> > that's going to take 1 minute to generate before it can be  
> > downloaded. Can I create a new Runnable class, push the WOContext  
> > (I guess) to it and start it's run() and have that thread return a  
> > response later using the WOContext while the user has gone off  
> > browsing other pages? If so how do I return that response?
> >
> It is not a push technology, you can't force content into the  
> browser, you can't force the browser to request content.
>
>
> > Right now, I use a long response task to generate the file and when  
> > the task is done the download begins using a contentStream response  
> > called by the end of the long response after the task is done. I  
> > would like to alleviate the need for the user to wait for the file  
> > to generate.
> >
> Open a new window for the download?


Opening a new window is probably the cleanest.

Just thinking out loud here: Another option might be to load it in a frame. Or if you have a "status bar" like section of your wrapper page template, it could use an internal IFrame to periodically poll the server and display status/messages. We currently use hidden IFrames to do Ajax-ish stuff on the same page, we've never tried it in a page wrapper, but I've been thinking about trying it out at some point. I don't know if there's a safe way to override appendToResponse and add some static status message div or something similar, but a page wrapper seems much cleaner.

Let us know how it goes.

Logan _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


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


  • Follow-Ups:
    • Re: How to return Response in same context from another thread?
      • From: Kieran Kelleher <email@hidden>
References: 
 >Re: How to return Response in same context from another thread? (From: email@hidden)

  • Prev by Date: Re: How to return Response in same context from another thread?
  • Next by Date: Re: EO Model (not the standalone EOModeler) in Xcode
  • Previous by thread: Re: How to return Response in same context from another thread?
  • Next by thread: Re: How to return Response in same context from another thread?
  • Index(es):
    • Date
    • Thread