What happened to akka.util.duration?

In a lot of old Akka examples you will see the following statements:

import akka.util.Timeout
import akka.util.duration._
implicit val askTimeout = Timeout(1 second)

This will give error ‘object duration is not a member of package akka.util’. It turns out duration is now included in Scala standard library. To fix the error use the following import statement:

import scala.concurrent.duration._

Check out the migration guide for other pieces of Akka functionality that have moved to Scala.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s