Re: [akka-user] Idiomatic way of creating a FiniteDuration from config?

2014-05-08 Thread Akka Team
Hi Brice, you can easily add a nicer syntax yourself: implicit class ConfigDuration(val c: Config) extends AnyVal { def getMillis(path: String): FiniteDuration = FiniteDuration(config.getDuration(path, MILLISECONDS), MILLISECONDS) } We have not done that yet because FiniteDuration lives in sca

[akka-user] Idiomatic way of creating a FiniteDuration from config?

2014-05-05 Thread Brice Figureau
Hi, Akka 2.3 now depends on Config 1.2.0. In Config 1.2 Config.getMilliseconds is now deprecated in favor of getDuration(key, timeUnit). With akka 2.2 (and prior) I was building FiniteDuration from config with: val backoff = FiniteDuration(config.getMilliseconds("backoff"), TimeUnit.MILLISECOND