[CLOSED] TaskManager not returning a 200 response until long running task has ended

  1. #1

    [CLOSED] TaskManager not returning a 200 response until long running task has ended

    I have a need to download large files. While the file is downloading I would like to use the taskmanager to check if the download is complete. If the download is complete then I need to refresh a grid. The download is started by clicking on a hyperlink and then the task starts. The task polls for a change in a session value. Once it finds that the session value has changed the task should stop.

    Looking at Fiddler, I see that a page is opened that starts the download as expected (result of the window.location) and I see that the polling starts as expected BUT the taskmanager does not return a response until the document has completed downloading. I have attatched images to see. For the file specified there were 9 trips to the server for the task and all of them remained with no response until the download response was completed. 10 connections were open. This is causing a huge contention on our servers and many users are complaining. I can remove the task but I need to know what is the best resolution. The end goal is that once the download process completes, I have to refresh a grid on the MyDocuments page with the download date information.

    I have removed the window.location = '' and then the task runs fine (I added a button to test stopping it). I believe it is how I am starting the download. I have to redirect to another page. The page never opens because we clear the response and then write the stream back. Is what I am trying to do possible?

    Markup
    
         <ext:XScript ID="XScript1" runat="server">        <script type="text/javascript">             var imageID;
                function linkTermRefClickHandler(urlForDownload, imageIDSelected) {                               // imageID so we know which folder to select                imageID = imageIDSelected;                // start the file download                                window.location = urlForDownload;                // show a mask                Ext.net.Mask.show({ msg: 'Downloading Document...' });                // start the task                #{TaskManager1}.startTask(0);            }
            </script>    </ext:XScript>
            <ext:TaskManager ID="TaskManager1" runat="server">            <Tasks>                <ext:Task TaskID="Task1" AutoRun="false" Interval="10000" >                           <DirectEvents>                        <Update OnEvent="RefreshProgress" Before="extraParams.SelectedImageID = imageID;" />                    </DirectEvents>                          </ext:Task>                                        </Tasks>        </ext:TaskManager>
    CodeBehind:

    
        Protected Sub RefreshProgress(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)          Dim sDownloadStatus = CStr(HttpContext.Current.Session("DownloadStatus"))          If sDownloadStatus = "Complete" Then            HttpContext.Current.Session("DownloadStatus") = "Idle"            Dim iImageID = e.ExtraParams.Item("SelectedImageID")            ResourceProxyMgr.AddScript("{0}.stopTask(0); {1}.refreshTree({1}, {2}); Ext.net.Mask.hide();", TaskManager1.ClientID, Grid1.TreeClientID, iImageID)         End If     End Sub
    Attached Thumbnails Click image for larger version. 

Name:	FiddlerNoResponse.png 
Views:	84 
Size:	6.4 KB 
ID:	5027   Click image for larger version. 

Name:	FiddlerFinalResponse.png 
Views:	76 
Size:	5.9 KB 
ID:	5028  
    Last edited by Daniil; Nov 09, 2012 at 2:55 PM. Reason: [CLOSED]
  2. #2
    This issue might be related to a Session limitation in ASP.NET, see

    http://forums.ext.net/showthread.php...ll=1#post72625
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] return html server response instead of just long extjs script!
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 17, 2011, 8:38 AM
  2. [CLOSED] Task Update DirectEvent in TaskManager
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 21, 2010, 8:30 PM
  3. [CLOSED] Update textfield value on a long running process
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 18, 2010, 11:30 AM
  4. HttpProxy Response Takes Too Long
    By Paully in forum 1.x Help
    Replies: 6
    Last Post: Nov 07, 2009, 7:00 AM

Posting Permissions