English 中文(简体)
Akka的未来时间
原标题:Timeout for Futures in Akka

We have a server that processes portfolio and securities (inside it) in different actors. For portfolio with smaller number of securities (<20) this works fine. When i increase the number of security count to 1000, encountered following issues:

akka.dispatch.FutureTimeoutException: Futures timed out after [5000] milliseconds

我可以绕过这一错误,在kka config内部增加时间,这是正确的事情吗? 在1.1.2之前的“kka”版本中,i可以自行确定。 行为者内部的时间不明确,但时间不明确。

我(有时)面临的另一个问题是,整个服务器在加入未来时hang。 我组合行动者的地图编码:

    //fork out for each security
    val listOfFutures = new ListBuffer[Future[Security]]()
    for (security <- portfolio.getSecurities.toList) {
      val securityProcessor = actorOf[SecurityProcessor].start()
      listOfFutures += (securityProcessor ? security) map {
        _.asInstanceOf[Security]
      }
    }
    EventHandler.info(this,"joining results from security processors")
    //join for each security
    val futures = Future.sequence(listOfFutures.toList)
    futures.map {
      listOfSecurities =>
        portfolioResponse = MergeHelper.merge(portfolio, listOfSecurities)
    }.get
问题回答

你没有说明你回过哪一个版本的Akka,而且鉴于我花了有限的时间,“晶球一”一片假定你会复1.2。

你们在提出要求时,可以具体指明时间表?

(此外,你的法典只是一纸空文,但我已经在你的其他问题中解决了。)

Cheers, √





相关问题
Problem with futures in c++0x

I have written a small program , to understand how futures work in c++0x. while running the code I get an error like " error: printEn was not declared in this scope". I am unable to understand what ...

Understanding future/threading

I am trying to use futures for the first time. It seems smart that you can cancel a job, but it is not working as expected. In the example below, only the first job is cancelled. The rest are ...

java.util.concurrent.Future.get() not returning

I have the following Java code: final Future future = exeService.submit( new Runnable() { public void run() { myObject.doSomething(); } } ); future.get(); where ...

ability to get the progress on a Future<T> object

With reference to the java.util.concurrent package and the Future interface I notice (unless I am mistaken) that the ability to start a lengthy tasks and be able to query on the progress only comes ...

热门标签