Extjs 两次ajax请求阻塞问题
我在 ajax 请求方面遇到问题。我需要他们独立前进,不要互相阻碍。
情况看起来是这样的。 我有第一个 ajax 请求,大约需要 1 分钟,还有多个其他请求,几乎是瞬时的。 1 分钟请求会阻止其他请求的发生。我需要一个解决办法。
编辑:
我在 firebug 中遇到了一个挂起的过程,通常会在 200 毫秒内结束。另一个问题是,如果我中止请求,它仍然需要与我没有中止相同的时间。一个错误还是我以错误的方式中止了它?
基本概念是这样的:
- 使用 onload 事件加载一个商店,其中有对 60 秒脚本的 Ajax 请求
- 我单击一个按钮,触发对 200 毫秒脚本的另一个 Ajax 请求,
- 第二个请求等待第一个请求结束,然后结束
我也尝试了不同的方法:
- 使用 onload 事件加载商店,该事件对 60 秒脚本发出 Ajax 请求
- 我单击一个按钮,触发另一个对 200 毫秒脚本的 Ajax 请求,
- 中止第一个 Ajax 请求
- 正如预期的那样,Firebug 显示请求已中止
- 第二个脚本仍然需要 60s+200ms 才能结束
有什么想法吗?
I have a problem with ajax requests. I need them to go independently not blocking each other.
The situation looks like this.
I have first ajax request which takes about 1minute and multiple other requests which are almost instantaneous. The 1minute request blocks other requests from happening. I need a way around.
Edit:
Well I get a hanging process in firebug which normally ends in 200ms. The other problem is if I abort the request it still takes same time as if I didn't aborted. A bug or am I aborting it in a wrong manner?
Base concept is like this:
- load a store with onload event which has Ajax request to 60s script
- I click a button that triggers another Ajax request to 200ms script
- the second request waits for the first to end and then ends
I tried a different aproach also:
- load a store with onload event which has Ajax request to 60s script
- I click a button that triggers another Ajax request to 200ms script
- abort first Ajax request
- as expected firebug shows the request was aborted
- the second script still takes 60s+200ms to end
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个会话问题。我打开了两个脚本的会话,第一个脚本在执行时锁定了会话文件。关闭其中一个脚本的会话解决了该问题。
It was a session problem. I opened the session for both scripts and first one locked the session file for the time of it's execution. Closing the session for one of the scripts solved the problem.