ajax big process导致所有其他进程延迟2分钟, [英] ajax big process causes all other processes to delay for 2 min,

查看:67
本文介绍了ajax big process导致所有其他进程延迟2分钟,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在工作中遇到了一个非常大的ajax问题。我希望有人可以帮助解决这个问题。 (抱歉,我没带c#代码回家)



我有一个控件可以对上传文件进行excel导入(这可能很费时) 。



我写了一个ajax脚本,在定时器上调用特定行号的aspx页面,获取excel表的当前处理行(不要问,这是他们想要的方式)和客户端PC上的更新并显示实际的实时百分比(每x秒)。



我成功地工作了(ajax脚本,经过测试)但问题是当excel命令执行时(在firebug上)它会导致所有其他java执行命令的延迟(通常为2分钟)(你可以看到在firebug上起球并且忙碌的信号正在转动) 。



现在,我怀疑(经过几个小时)是所有其他java线程都被解雇但因为他们使用ajax等待成功命令,他们不会在客户端的电脑上完成/发送并仍在等待f或来自服务器的回复。



有什么建议吗?

I got a pretty big ajax problem at work. I hope someone can help on this this. (Sorry, I didn't bring the c# code home)

I got this one control that does a excel import (which can be time consuming) of a uploaded file.

I wrote a ajax script that calls a aspx page on a timer for a specific line number, that gets the current processed line of the excel sheet (don't ask, this was the way they wanted it) and updates on the clients pc and show a actual real time percentage (every x seconds).

I got it working successfully (the ajax script, tested) but the problem is when the excel command executes (on firebug) it causes a delay (usually 2 minutes) of all other java execute commands (which you can see pilling on firebug and there busy signals are turning).

Now, what I suspect (after loads of hours) is that all the other java threads have fired but because they use the ajax wait for success command, they don't get completed/send on the client's pc and is still waiting for a response from the server.

Any suggestions?

推荐答案

因为你的方法很费时间应该像下面的例子一样使用异步调用:



http://deekodev.wordpress.com/2012/01/04/easy-asynchronous-data-loading-with-asp-net-ajax/ [ ^ ]



http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax。 aspx [ ^ ]
Because your method is time consuming you should use Asynchronous call like in the next examples:

http://deekodev.wordpress.com/2012/01/04/easy-asynchronous-data-loading-with-asp-net-ajax/[^]

http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx[^]


这篇关于ajax big process导致所有其他进程延迟2分钟,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆