dwr 中的透明批处理远程调用

发布于 2024-07-15 11:59:17 字数 156 浏览 3 评论 0原文

我希望 DWR 透明地批处理在处理同一事件过程中完成的所有远程调用。

原因是在 Javascript 中处理一个事件必须只需要很短的时间,并且在同一时间内不能发生任何其他事情。 因此,如果我要进行许多调用,我希望 DWR 透明地对它们进行批处理。 那可能吗? 如何?

I want DWR to transparently batch all remote calls that are done in the course of handling the same event.

The reason is that handling an event in Javascript must only take a short time and nothing else can happen during the same time. So if I am going to do many calls, I would like to DWR batch them transparenty. Is that possible? How?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅忆流年 2024-07-22 11:59:17

DWR 的网站解释了调用批处理

来自另一个 DWR 页面

远程调用可以批量处理在一起
以减少延迟。 选项还可以
在 endBatch() 方法上设置:

dwr.engine.beginBatch(); 
  Remote.methodInBatch1(params, 回调1); 
  Remote.methodInBatch2(params, 回调2); 
  dwr.engine.endBatch({ 
    超时:3000 
  }); 
  

DWR's website explains Call Batching.

From another DWR page:

Remote calls can be batched together
to reduce latency. Options can also be
set on the endBatch() method:

dwr.engine.beginBatch();
Remote.methodInBatch1(params, callback1);
Remote.methodInBatch2(params, callback2);
dwr.engine.endBatch({
  timeout:3000
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文