Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance RPC调用前的巨大延迟_Performance_Web Services_Gwt_Playframework_Rpc - Fatal编程技术网

Performance RPC调用前的巨大延迟

Performance RPC调用前的巨大延迟,performance,web-services,gwt,playframework,rpc,Performance,Web Services,Gwt,Playframework,Rpc,我目前正在编写一个web应用程序,其中包含一个web服务器(Play!framework)和一个GWT UI。它是一个单页应用程序:一些小部件在执行过程中显示或隐藏 在这个应用程序中,我想使用RPC调用调用aynchronous服务。它有一个非常简单的参数(Long),尽管它的返回类型要复杂得多。 我遇到的问题是,RPC调用和实际服务执行之间有很长的延迟(可以是3秒到18秒,平均5秒)。这种延迟发生在生产模式中(当然也发生在开发模式中) 客户端: // print current time

我目前正在编写一个web应用程序,其中包含一个web服务器(Play!framework)和一个GWT UI。它是一个单页应用程序:一些小部件在执行过程中显示或隐藏

在这个应用程序中,我想使用RPC调用调用aynchronous服务。它有一个非常简单的参数(Long),尽管它的返回类型要复杂得多。 我遇到的问题是,RPC调用和实际服务执行之间有很长的延迟(可以是3秒到18秒,平均5秒)。这种延迟发生在生产模式中(当然也发生在开发模式中)

客户端:

  // print current time
  coolServices.doSomething(id, new AsyncCallback<ComplexType>() {

  @Override
  public void onFailure(Throwable caught) {
    // error
  }

  @Override
  public void onSuccess(ComplexType result) {
    //success
    }
  }
});
}

你有解决这个问题的办法吗? 顺便说一下,我相信服务调用时事件队列是空的

提前感谢,,
xela85

您的问题不清楚这种延迟发生在哪里。是在您调用此服务和服务器收到调用之间(不太可能),还是服务器开始返回响应,或者客户端得到完整响应之间?是在我调用此服务和服务器收到call之间,我在数百个RPC调用中使用了类似的代码,我从未见过这样的延迟。您的代码中一定发生了其他事情。你的ComplexType有多复杂?我也有同样的问题。到目前为止有什么解决办法吗?
@Override
  public ComplexType doSomething(Long id) throws IllegalArgumentException {
            // print current time
            // do something...
    return response;