diff --git a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java index cb9b99fadc..a87b7933d8 100644 --- a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java +++ b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java @@ -1,6 +1,6 @@ package akka.dispatch; -import akka.actor.Timeout; +import akka.util.Timeout; import akka.actor.ActorSystem; import akka.japi.*; @@ -21,7 +21,7 @@ public class JavaFutureTests { private static ActorSystem system; private static Timeout t; - + private final Duration timeout = Duration.create(5, TimeUnit.SECONDS); @BeforeClass diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index 248b665b63..43af040d62 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -8,6 +8,7 @@ import org.scalatest.WordSpec import org.scalatest.matchers.MustMatchers import akka.testkit._ +import akka.util.Timeout import akka.util.duration._ import java.lang.IllegalStateException import akka.util.ReflectiveAccess diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorTimeoutSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorTimeoutSpec.scala index 4df3b0d5e9..a4c1757a0b 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorTimeoutSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorTimeoutSpec.scala @@ -9,6 +9,7 @@ import akka.testkit.AkkaSpec import akka.testkit.DefaultTimeout import java.util.concurrent.TimeoutException import akka.dispatch.Await +import akka.util.Timeout @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) class ActorTimeoutSpec extends AkkaSpec with BeforeAndAfterAll with DefaultTimeout { diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index bb3bf4c58e..2414a173cf 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -6,6 +6,7 @@ package akka.actor import akka.testkit._ import akka.util.duration._ +import akka.util.Timeout import akka.dispatch.{ Await, Future } @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) diff --git a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala index f50b9bd381..e86e6d4c8e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala @@ -6,6 +6,7 @@ package akka.actor import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } import akka.util.Duration +import akka.util.Timeout import akka.util.duration._ import akka.serialization.Serialization import java.util.concurrent.atomic.AtomicReference diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index ced2b0d158..a709b16267 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -6,6 +6,7 @@ package akka.actor.dispatch import org.scalatest.Assertions._ import akka.testkit._ import akka.dispatch._ +import akka.util.Timeout import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch, TimeUnit } import akka.util.Switch @@ -493,4 +494,4 @@ class BalancingDispatcherModelSpec extends ActorModelSpec { assertRefDefaultZero(b)(registers = 1, unregisters = 1, msgsReceived = 1, msgsProcessed = 1) } } -} \ No newline at end of file +} diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala index e41dc9c4cd..b3ce0108dd 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala @@ -2,7 +2,7 @@ package akka.dispatch import Future.flow import akka.util.cps._ -import akka.actor.Timeout +import akka.util.Timeout import akka.util.duration._ import akka.testkit.AkkaSpec import akka.testkit.DefaultTimeout diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index 72c4ecabc3..4d92988422 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -113,32 +113,6 @@ object Status { case class Failure(cause: Throwable) extends Status } -case class Timeout(duration: Duration) { - def this(timeout: Long) = this(Duration(timeout, TimeUnit.MILLISECONDS)) - def this(length: Long, unit: TimeUnit) = this(Duration(length, unit)) -} - -object Timeout { - /** - * A timeout with zero duration, will cause most requests to always timeout. - */ - val zero = new Timeout(Duration.Zero) - - /** - * A Timeout with infinite duration. Will never timeout. Use extreme caution with this - * as it may cause memory leaks, blocked threads, or may not even be supported by - * the receiver, which would result in an exception. - */ - val never = new Timeout(Duration.Inf) - - def apply(timeout: Long) = new Timeout(timeout) - def apply(length: Long, unit: TimeUnit) = new Timeout(length, unit) - - implicit def durationToTimeout(duration: Duration) = new Timeout(duration) - implicit def intToTimeout(timeout: Int) = new Timeout(timeout) - implicit def longToTimeout(timeout: Long) = new Timeout(timeout) -} - trait ActorLogging { this: Actor ⇒ val log = akka.event.Logging(context.system.eventStream, context.self) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 4b081f6ee8..acaad1dbe4 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -6,8 +6,12 @@ package akka.actor import java.util.concurrent.atomic.AtomicLong import org.jboss.netty.akka.util.{ TimerTask, HashedWheelTimer } +import akka.util.Timeout +import akka.util.Timeout.intToTimeout +import akka.config.ConfigurationException import akka.dispatch._ import akka.routing._ +import akka.util.Timeout import akka.AkkaException import akka.util.{ Duration, Switch, Helpers } import akka.event._ @@ -340,7 +344,7 @@ class LocalActorRefProvider( } /* - * Guardians can be asked by ActorSystem to create children, i.e. top-level + * Guardians can be asked by ActorSystem to create children, i.e. top-level * actors. Therefore these need to answer to these requests, forwarding any * exceptions which might have occurred. */ @@ -355,7 +359,7 @@ class LocalActorRefProvider( } /* - * Guardians can be asked by ActorSystem to create children, i.e. top-level + * Guardians can be asked by ActorSystem to create children, i.e. top-level * actors. Therefore these need to answer to these requests, forwarding any * exceptions which might have occurred. */ diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index d644933588..974844ef86 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -8,6 +8,8 @@ import akka.actor._ import akka.event._ import akka.dispatch._ import akka.util.duration._ +import akka.util.Timeout +import akka.util.Timeout._ import org.jboss.netty.akka.util.HashedWheelTimer import java.util.concurrent.TimeUnit.MILLISECONDS import java.util.concurrent.TimeUnit.NANOSECONDS diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index daf8f075d8..aa0c246b6f 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -6,7 +6,7 @@ package akka.actor import akka.japi.{ Creator, Option ⇒ JOption } import java.lang.reflect.{ InvocationTargetException, Method, InvocationHandler, Proxy } -import akka.util.{ Duration } +import akka.util.{ Duration, Timeout } import java.util.concurrent.atomic.{ AtomicReference ⇒ AtomVar } import akka.serialization.{ Serializer, Serialization } import akka.dispatch._ @@ -490,4 +490,4 @@ class TypedActorExtension(system: ActorSystemImpl) extends TypedActorFactory wit } } else null -} \ No newline at end of file +} diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 2bbc1fcb15..bd436d79c9 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -7,7 +7,7 @@ package akka.dispatch import akka.AkkaException import akka.event.Logging.Error -import akka.actor.Timeout +import akka.util.Timeout import scala.Option import akka.japi.{ Procedure, Function ⇒ JFunc, Option ⇒ JOption } diff --git a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala index 4ec0aaf300..b6305701b2 100644 --- a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala +++ b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala @@ -7,7 +7,7 @@ package akka.dispatch import java.util.concurrent.atomic.AtomicReference import scala.util.continuations._ import scala.annotation.{ tailrec } -import akka.actor.Timeout +import akka.util.Timeout object PromiseStream { def apply[A]()(implicit dispatcher: MessageDispatcher, timeout: Timeout): PromiseStream[A] = new PromiseStream[A] diff --git a/akka-actor/src/main/scala/akka/dispatch/japi/Future.scala b/akka-actor/src/main/scala/akka/dispatch/japi/Future.scala index 64852912fe..789cf1bf21 100644 --- a/akka-actor/src/main/scala/akka/dispatch/japi/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/japi/Future.scala @@ -3,7 +3,7 @@ */ package akka.dispatch.japi -import akka.actor.Timeout +import akka.util.Timeout import akka.japi.{ Procedure2, Procedure, Function ⇒ JFunc, Option ⇒ JOption } /* Java API */ diff --git a/akka-actor/src/main/scala/akka/event/Logging.scala b/akka-actor/src/main/scala/akka/event/Logging.scala index 016d977d40..face9a20d9 100644 --- a/akka-actor/src/main/scala/akka/event/Logging.scala +++ b/akka-actor/src/main/scala/akka/event/Logging.scala @@ -10,7 +10,7 @@ import akka.util.ReflectiveAccess import akka.config.ConfigurationException import akka.util.ReentrantGuard import akka.util.duration._ -import akka.actor.Timeout +import akka.util.Timeout import java.util.concurrent.atomic.AtomicInteger import akka.actor.ActorRefProvider import scala.util.control.NoStackTrace diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index a321bb8983..6c3fb7e03a 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -4,12 +4,11 @@ package akka.routing import akka.actor._ - import akka.japi.Creator import java.lang.reflect.InvocationTargetException import akka.config.ConfigurationException import java.util.concurrent.atomic.AtomicInteger -import akka.util.ReflectiveAccess +import akka.util.{ ReflectiveAccess, Timeout } import akka.AkkaException import scala.collection.JavaConversions._ import java.util.concurrent.TimeUnit diff --git a/akka-actor/src/main/scala/akka/util/Duration.scala b/akka-actor/src/main/scala/akka/util/Duration.scala index fba61c8a48..d404300a49 100644 --- a/akka-actor/src/main/scala/akka/util/Duration.scala +++ b/akka-actor/src/main/scala/akka/util/Duration.scala @@ -543,3 +543,29 @@ class DurationDouble(d: Double) { def day[C, CC <: Classifier[C]](c: C)(implicit ev: CC): CC#R = ev.convert(Duration(d, DAYS)) } +case class Timeout(duration: Duration) { + def this(timeout: Long) = this(Duration(timeout, TimeUnit.MILLISECONDS)) + def this(length: Long, unit: TimeUnit) = this(Duration(length, unit)) +} + +object Timeout { + /** + * A timeout with zero duration, will cause most requests to always timeout. + */ + val zero = new Timeout(Duration.Zero) + + /** + * A Timeout with infinite duration. Will never timeout. Use extreme caution with this + * as it may cause memory leaks, blocked threads, or may not even be supported by + * the receiver, which would result in an exception. + */ + val never = new Timeout(Duration.Inf) + + def apply(timeout: Long) = new Timeout(timeout) + def apply(length: Long, unit: TimeUnit) = new Timeout(length, unit) + + implicit def durationToTimeout(duration: Duration) = new Timeout(duration) + implicit def intToTimeout(timeout: Int) = new Timeout(timeout) + implicit def longToTimeout(timeout: Long) = new Timeout(timeout) +} + diff --git a/akka-actor/src/main/scala/akka/util/cps/package.scala b/akka-actor/src/main/scala/akka/util/cps/package.scala index 7cbf60aaf2..2182d412e3 100644 --- a/akka-actor/src/main/scala/akka/util/cps/package.scala +++ b/akka-actor/src/main/scala/akka/util/cps/package.scala @@ -2,7 +2,7 @@ package akka.util import scala.util.continuations._ import akka.dispatch.MessageDispatcher -import akka.actor.Timeout +import akka.util.Timeout package object cps { def matchC[A, B, C, D](in: A)(pf: PartialFunction[A, B @cpsParam[C, D]]): B @cpsParam[C, D] = pf(in) diff --git a/akka-camel-typed/src/test/java/akka/camel/TypedConsumerJavaTestBase.java b/akka-camel-typed/src/test/java/akka/camel/TypedConsumerJavaTestBase.java index 232ef0d2df..d6ea1da9f4 100644 --- a/akka-camel-typed/src/test/java/akka/camel/TypedConsumerJavaTestBase.java +++ b/akka-camel-typed/src/test/java/akka/camel/TypedConsumerJavaTestBase.java @@ -3,7 +3,7 @@ package akka.camel; import akka.actor.Actor; import akka.actor.TypedActor; import akka.actor.Props; -import akka.actor.Timeout; +import akka.util.Timeout; import akka.dispatch.Dispatchers; import akka.japi.SideEffect; import akka.util.FiniteDuration; diff --git a/akka-docs/scala/actors.rst b/akka-docs/scala/actors.rst index 663c07c70a..d602e86cbd 100644 --- a/akka-docs/scala/actors.rst +++ b/akka-docs/scala/actors.rst @@ -296,11 +296,15 @@ If the actor does not complete the future, it will expire after the timeout peri which is taken from one of the following locations in order of precedence: #. explicitly given timeout as in ``actor.?("hello")(timeout = 12 millis)`` -#. implicit argument of type :class:`akka.actor.Timeout`, e.g. +#. implicit argument of type :class:`akka.util.Timeout`, e.g. :: +<<<<<<< HEAD import akka.actor.Timeout +======= + import akka.util.Timeout +>>>>>>> wip-remove-timeout-jboner import akka.util.duration._ implicit val timeout = Timeout(12 millis) @@ -407,9 +411,14 @@ object. Stopping actors =============== +<<<<<<< HEAD Actors are stopped by invoking the ``stop`` method of the ``ActorContext`` for child actors or ``stop`` method of the ``ActorSystem`` for top level actors. The actual termination of the actor is performed asynchronously, i.e. +======= +Actors are stopped by invoking the ``stop`` method of the ``ActorRef``. +The actual termination of the actor is performed asynchronously, i.e. +>>>>>>> wip-remove-timeout-jboner ``stop`` may return before the actor is stopped. .. code-block:: scala diff --git a/akka-docs/scala/futures.rst b/akka-docs/scala/futures.rst index 623a24730a..442009beb6 100644 --- a/akka-docs/scala/futures.rst +++ b/akka-docs/scala/futures.rst @@ -198,7 +198,7 @@ Then there's a method that's called ``fold`` that takes a start-value, a sequenc .. code-block:: scala val futures = for(i <- 1 to 1000) yield Future(i * 2) // Create a sequence of Futures - + val futureSum = Future.fold(0)(futures)(_ + _) That's all it takes! @@ -244,7 +244,7 @@ In this example, if an ``ArithmeticException`` was thrown while the ``Actor`` pr Timeouts -------- -Waiting forever for a ``Future`` to be completed can be dangerous. It could cause your program to block indefinitly or produce a memory leak. ``Future`` has support for a timeout already builtin with a default of 5 seconds (taken from :ref:`configuration`). A timeout is an instance of ``akka.actor.Timeout`` which contains an ``akka.util.Duration``. A ``Duration`` can be finite, which needs a length and unit type, or infinite. An infinite ``Timeout`` can be dangerous since it will never actually expire. +Waiting forever for a ``Future`` to be completed can be dangerous. It could cause your program to block indefinitly or produce a memory leak. ``Future`` has support for a timeout already builtin with a default of 5 seconds (taken from :ref:`configuration`). A timeout is an instance of ``akka.util.Timeout`` which contains an ``akka.util.Duration``. A ``Duration`` can be finite, which needs a length and unit type, or infinite. An infinite ``Timeout`` can be dangerous since it will never actually expire. A different ``Timeout`` can be supplied either explicitly or implicitly when a ``Future`` is created. An implicit ``Timeout`` has the benefit of being usable by a for-comprehension as well as being picked up by any methods looking for an implicit ``Timeout``, while an explicit ``Timeout`` can be used in a more controlled manner. @@ -262,7 +262,7 @@ Implicit ``Timeout`` example: .. code-block:: scala - import akka.actor.Timeout + import akka.util.Timeout import akka.util.duration._ implicit val longTimeout = Timeout(1 minute) diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 5a8afd5a5b..99524ad3b6 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -6,7 +6,10 @@ package akka.remote import akka.actor._ import akka.dispatch._ -import akka.event.Logging +import akka.util.duration._ +import akka.util.Timeout +import akka.config.ConfigurationException +import akka.event.{ DeathWatch, Logging } import akka.serialization.Compression.LZF import akka.remote.RemoteProtocol._ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ @@ -62,24 +65,24 @@ class RemoteActorRefProvider( /* * This needs to deal with “mangled” paths, which are created by remote * deployment, also in this method. The scheme is the following: - * - * Whenever a remote deployment is found, create a path on that remote + * + * Whenever a remote deployment is found, create a path on that remote * address below “remote”, including the current system’s identification * as “sys@host:port” (typically; it will use whatever the remote * transport uses). This means that on a path up an actor tree each node * change introduces one layer or “remote/sys@host:port/” within the URI. - * + * * Example: - * + * * akka://sys@home:1234/remote/sys@remote:6667/remote/sys@other:3333/user/a/b/c - * - * means that the logical parent originates from “sys@other:3333” with - * one child (may be “a” or “b”) being deployed on “sys@remote:6667” and - * finally either “b” or “c” being created on “sys@home:1234”, where - * this whole thing actually resides. Thus, the logical path is - * “/user/a/b/c” and the physical path contains all remote placement + * + * means that the logical parent originates from “sys@other:3333” with + * one child (may be “a” or “b”) being deployed on “sys@remote:6667” and + * finally either “b” or “c” being created on “sys@home:1234”, where + * this whole thing actually resides. Thus, the logical path is + * “/user/a/b/c” and the physical path contains all remote placement * information. - * + * * Deployments are always looked up using the logical path, which is the * purpose of the lookupRemotes internal method. */ diff --git a/akka-stm/src/main/scala/akka/agent/Agent.scala b/akka-stm/src/main/scala/akka/agent/Agent.scala index 25849c31f3..a5bece2b5c 100644 --- a/akka-stm/src/main/scala/akka/agent/Agent.scala +++ b/akka-stm/src/main/scala/akka/agent/Agent.scala @@ -9,6 +9,7 @@ import akka.actor._ import akka.stm._ import akka.japi.{ Function ⇒ JFunc, Procedure ⇒ JProc } import akka.dispatch._ +import akka.util.Timeout /** * Used internally to send functions. diff --git a/akka-stm/src/test/scala/akka/agent/test/AgentSpec.scala b/akka-stm/src/test/scala/akka/agent/test/AgentSpec.scala index 901e45cd8a..b834489e6e 100644 --- a/akka-stm/src/test/scala/akka/agent/test/AgentSpec.scala +++ b/akka-stm/src/test/scala/akka/agent/test/AgentSpec.scala @@ -3,7 +3,7 @@ package akka.agent.test import org.scalatest.WordSpec import org.scalatest.matchers.MustMatchers import akka.actor.ActorSystem -import akka.actor.Timeout +import akka.util.Timeout import akka.agent.Agent import akka.stm._ import akka.util.Duration diff --git a/akka-stm/src/test/scala/akka/transactor/test/CoordinatedIncrementSpec.scala b/akka-stm/src/test/scala/akka/transactor/test/CoordinatedIncrementSpec.scala index d3a23a8191..660945db4a 100644 --- a/akka-stm/src/test/scala/akka/transactor/test/CoordinatedIncrementSpec.scala +++ b/akka-stm/src/test/scala/akka/transactor/test/CoordinatedIncrementSpec.scala @@ -6,6 +6,7 @@ import akka.actor.ActorSystem import akka.actor._ import akka.stm.{ Ref, TransactionFactory } import akka.util.duration._ +import akka.util.Timeout import akka.testkit._ import akka.dispatch.Await diff --git a/akka-stm/src/test/scala/akka/transactor/test/FickleFriendsSpec.scala b/akka-stm/src/test/scala/akka/transactor/test/FickleFriendsSpec.scala index 7fdc55f91d..5a850444c9 100644 --- a/akka-stm/src/test/scala/akka/transactor/test/FickleFriendsSpec.scala +++ b/akka-stm/src/test/scala/akka/transactor/test/FickleFriendsSpec.scala @@ -5,6 +5,7 @@ import org.scalatest.matchers.MustMatchers import org.scalatest.BeforeAndAfterAll import akka.actor.ActorSystem import akka.actor._ +import akka.util.Timeout import akka.stm._ import akka.util.duration._ import akka.testkit._ diff --git a/akka-stm/src/test/scala/akka/transactor/test/TransactorSpec.scala b/akka-stm/src/test/scala/akka/transactor/test/TransactorSpec.scala index f82f224870..545ef13c6a 100644 --- a/akka-stm/src/test/scala/akka/transactor/test/TransactorSpec.scala +++ b/akka-stm/src/test/scala/akka/transactor/test/TransactorSpec.scala @@ -5,6 +5,7 @@ import org.scalatest.matchers.MustMatchers import akka.actor.ActorSystem import akka.actor._ +import akka.util.Timeout import akka.stm._ import akka.util.duration._ import akka.testkit._ diff --git a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java index efec273469..d4c0b5b3dc 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java +++ b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java @@ -5,8 +5,17 @@ package akka.tutorial.first.java; //#imports -import akka.actor.*; -import akka.routing.RoundRobinRouter; +import akka.actor.Props; +import akka.actor.ActorRef; +import akka.actor.ActorSystem; +import akka.actor.InternalActorRef; +import akka.actor.UntypedActor; +import akka.actor.UntypedActorFactory; +import akka.japi.Creator; +import akka.routing.*; +import akka.util.Timeout; + +import java.util.LinkedList; import java.util.concurrent.CountDownLatch; //#imports