Permalink
Browse files

[fixes lh 406] make Promises' default timeout configurable

the default remained the same ie 5s
  • Loading branch information...
1 parent cf167e4 commit 7b45f3f35d7cfb57994772a15a3abe14719f01c4 @pk11 pk11 committed May 16, 2012
@@ -9,6 +9,9 @@ logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
+#default timeout for promises
+promise.akka.actor.typed.timeout=5s
+
play {
akka {
@@ -35,13 +38,6 @@ play {
}
}
- promises-dispatcher = {
- fork-join-executor {
- parallelism-factor = 1.0
- parallelism-max = 24
- }
- }
-
websockets-dispatcher = {
fork-join-executor {
parallelism-factor = 1.0
@@ -4,6 +4,7 @@ import play.core._
import play.api._
import akka.actor._
+import akka.util.Duration
import akka.actor.Actor._
import java.util.concurrent.{ TimeUnit }
@@ -52,7 +53,7 @@ trait Promise[+A] {
def value = await
- def await: NotWaiting[A] = await(5000)
+ def await: NotWaiting[A] = await(Promise.defaultTimeout)
def await(timeout: Long, unit: TimeUnit = TimeUnit.MILLISECONDS): NotWaiting[A]
@@ -250,6 +251,9 @@ object PurePromise {
}
object Promise {
+
+ private [concurrent] lazy val defaultTimeout =
+ Duration(system.settings.config.getMilliseconds("promise.akka.actor.typed.timeout"), TimeUnit.MILLISECONDS).toMillis
private [concurrent] lazy val system = ActorSystem("promise")

0 comments on commit 7b45f3f

Please sign in to comment.