move everything into package akka.pattern
This commit is contained in:
parent
9c762dec20
commit
2bed2cb954
59 changed files with 73 additions and 73 deletions
|
|
@ -8,7 +8,7 @@ import akka.testkit._
|
|||
import org.scalatest.BeforeAndAfterEach
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorFireForgetRequestReplySpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import akka.testkit._
|
|||
import akka.util.duration._
|
||||
import java.util.concurrent.atomic._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorLifeCycleSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package akka.actor
|
|||
import akka.testkit._
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorLookupSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import akka.util.ReflectiveAccess
|
|||
import akka.serialization.Serialization
|
||||
import java.util.concurrent.{ CountDownLatch, TimeUnit }
|
||||
import akka.dispatch.{ Await, DefaultPromise, Promise, Future }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorRefSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import akka.testkit.DefaultTimeout
|
|||
import java.util.concurrent.TimeoutException
|
||||
import akka.dispatch.Await
|
||||
import akka.util.Timeout
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class ActorTimeoutSpec extends AkkaSpec with BeforeAndAfterAll with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import akka.testkit._
|
|||
import akka.util.duration._
|
||||
import java.util.concurrent.atomic._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class LocalDeathWatchSpec extends AkkaSpec with ImplicitSender with DefaultTimeout with DeathWatchSpec
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import akka.util.duration._
|
|||
import Actor._
|
||||
import akka.util.Duration
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ForwardActorSpec {
|
||||
val ExpectedMessage = "FOO"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import akka.util.cps._
|
|||
import scala.util.continuations._
|
||||
import akka.testkit._
|
||||
import akka.dispatch.{ Await, Future }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object IOActorSpec {
|
||||
import IO._
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import akka.testkit.AkkaSpec
|
|||
import akka.testkit.DefaultTimeout
|
||||
import akka.testkit.TestLatch
|
||||
import akka.util.duration._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.{ CountDownLatch, ConcurrentLinkedQueue, TimeUnit }
|
|||
import akka.testkit.DefaultTimeout
|
||||
import akka.testkit.TestLatch
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class SchedulerSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import akka.testkit._
|
|||
|
||||
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object SupervisorHierarchySpec {
|
||||
class FireWorkerException(msg: String) extends Exception(msg)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import akka.dispatch.{ PinnedDispatcher, Dispatchers, Await }
|
|||
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object SupervisorMiscSpec {
|
||||
val config = """
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import akka.testkit.TestEvent._
|
|||
import akka.testkit._
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object SupervisorSpec {
|
||||
val Timeout = 5 seconds
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import akka.testkit.AkkaSpec
|
|||
import akka.testkit.ImplicitSender
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.{ Await, Dispatchers }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class SupervisorTreeSpec extends AkkaSpec with ImplicitSender with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import akka.testkit.AkkaSpec
|
|||
import akka.testkit.ImplicitSender
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
|||
import akka.japi.{ Creator, Option ⇒ JOption }
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.{ Await, Dispatchers, Future, Promise }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object TypedActorSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import akka.util.duration._
|
|||
import akka.event.Logging.Error
|
||||
import com.typesafe.config.Config
|
||||
import akka.util.Duration
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorModelSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import akka.util.Duration
|
|||
import akka.util.duration._
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.{ Await, PinnedDispatcher, Dispatchers, Dispatcher }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object DispatcherActorSpec {
|
||||
val config = """
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import akka.actor.{ Props, Actor }
|
|||
import akka.testkit.AkkaSpec
|
||||
import org.scalatest.BeforeAndAfterEach
|
||||
import akka.dispatch.{ Await, PinnedDispatcher, Dispatchers }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object PinnedActorSpec {
|
||||
val config = """
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import akka.actor.future2actor
|
|||
import akka.util.duration._
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
class Future2ActorSpec extends AkkaSpec with DefaultTimeout {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import akka.testkit.DefaultTimeout
|
|||
import akka.testkit.TestLatch
|
||||
import java.util.concurrent.{ TimeoutException, TimeUnit, CountDownLatch }
|
||||
import scala.runtime.NonLocalReturnControl
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object FutureSpec {
|
||||
class TestActor extends Actor {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package akka.dispatch
|
|||
|
||||
import akka.actor.{ Props, LocalActorRef, Actor }
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
import akka.util.duration._
|
||||
import akka.testkit.DefaultTimeout
|
||||
import com.typesafe.config.Config
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import akka.util.duration._
|
|||
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger }
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.dispatch.{ Await, Promise, Future }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object ActorPoolSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import java.util.concurrent.atomic.AtomicInteger
|
|||
import akka.testkit._
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class ConfiguredLocalRoutingSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import akka.dispatch.Await
|
|||
import akka.util.Duration
|
||||
import akka.config.ConfigurationException
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object RoutingSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import akka.util.Timeout
|
|||
import akka.util.duration._
|
||||
import scala.reflect.BeanInfo
|
||||
import com.google.protobuf.Message
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
class ProtobufSerializer extends Serializer {
|
||||
val ARRAY_OF_BYTE_ARRAY = Array[Class[_]](classOf[Array[Byte]])
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import akka.routing._
|
|||
import akka.testkit.AkkaSpec
|
||||
import akka.dispatch.Await
|
||||
import akka.util.duration._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class Ticket703Spec extends AkkaSpec {
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ trait LocalRef extends ActorRefScope {
|
|||
}
|
||||
|
||||
/**
|
||||
* Trait for matching on ActorRefs which have access to a provider; this is used in akka.patterns.ask.
|
||||
* Trait for matching on ActorRefs which have access to a provider; this is used in akka.pattern.ask.
|
||||
*/
|
||||
trait ActorRefWithProvider { this: InternalActorRef ⇒
|
||||
def provider: ActorRefProvider
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import akka.config.ConfigurationException
|
|||
import akka.actor._
|
||||
import akka.event._
|
||||
import akka.dispatch._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
import akka.util.duration._
|
||||
import akka.util.Timeout
|
||||
import akka.util.Timeout._
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
|
|||
case "equals" ⇒ (args.length == 1 && (proxy eq args(0)) || actor == extension.getActorRefFor(args(0))).asInstanceOf[AnyRef] //Force boxing of the boolean
|
||||
case "hashCode" ⇒ actor.hashCode.asInstanceOf[AnyRef]
|
||||
case _ ⇒
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
MethodCall(method, args) match {
|
||||
case m if m.isOneWay ⇒ actor ! m; null //Null return value
|
||||
case m if m.returnsFuture_? ⇒ actor.?(m, timeout)
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ trait LoggingBus extends ActorEventBus {
|
|||
val name = "log" + Extension(system).id() + "-" + simpleName(clazz)
|
||||
val actor = system.systemActorOf(Props(clazz), name)
|
||||
implicit val timeout = Timeout(3 seconds)
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
val response = try Await.result(actor ? InitializeLogger(this), timeout.duration) catch {
|
||||
case _: TimeoutException ⇒
|
||||
publish(Warning(simpleName(this), "Logger " + name + " did not respond within " + timeout + " to InitializeLogger(bus)"))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.patterns
|
||||
package akka.pattern
|
||||
|
||||
import akka.actor.{ ActorRef, InternalActorRef, AskTimeoutException }
|
||||
import akka.dispatch.{ Future, Promise }
|
||||
|
|
@ -37,7 +37,7 @@ final class AskableActorRef(val actorRef: ActorRef) {
|
|||
*
|
||||
* [see the [[akka.dispatch.Future]] companion object for a description of `flow`]
|
||||
*/
|
||||
def ask(message: AnyRef)(implicit timeout: Timeout): Future[Any] = akka.patterns.ask(actorRef, message)(timeout)
|
||||
def ask(message: AnyRef)(implicit timeout: Timeout): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
|
||||
|
||||
/**
|
||||
* Sends a message asynchronously and returns a [[akka.dispatch.Future]]
|
||||
|
|
@ -67,7 +67,7 @@ final class AskableActorRef(val actorRef: ActorRef) {
|
|||
*
|
||||
* [see the [[akka.dispatch.Future]] companion object for a description of `flow`]
|
||||
*/
|
||||
def ?(message: Any)(implicit timeout: Timeout): Future[Any] = akka.patterns.ask(actorRef, message)
|
||||
def ?(message: Any)(implicit timeout: Timeout): Future[Any] = akka.pattern.ask(actorRef, message)
|
||||
|
||||
/*
|
||||
* FIXME: I think this should be removed, since it introduces an “ambiguity”
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka
|
||||
package akka.pattern
|
||||
|
||||
object Patterns {
|
||||
import akka.actor.ActorRef
|
||||
import akka.dispatch.Future
|
||||
import akka.patterns.{ ask ⇒ scalaAsk }
|
||||
import akka.pattern.{ ask ⇒ scalaAsk }
|
||||
import akka.util.Timeout
|
||||
|
||||
/**
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package akka
|
||||
|
||||
package object patterns {
|
||||
package object pattern {
|
||||
|
||||
import akka.actor.{ ActorRef, InternalActorRef, ActorRefWithProvider, AskTimeoutException }
|
||||
import akka.dispatch.{ Future, Promise }
|
||||
|
|
@ -15,7 +15,7 @@ package object patterns {
|
|||
* `ask(actorRef, message)(timeout)` method defined here.
|
||||
*
|
||||
* {{{
|
||||
* import akka.patterns.ask
|
||||
* import akka.pattern.ask
|
||||
*
|
||||
* val future = actor ? message // => ask(actor, message)
|
||||
* val future = actor ask message // => ask(actor, message)
|
||||
|
|
@ -7,7 +7,7 @@ package akka.agent
|
|||
import akka.actor._
|
||||
import akka.japi.{ Function ⇒ JFunc, Procedure ⇒ JProc }
|
||||
import akka.dispatch._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
import akka.util.Timeout
|
||||
import scala.concurrent.stm._
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import akka.actor.Props;
|
|||
import akka.actor.Terminated;
|
||||
import akka.actor.UntypedActor;
|
||||
import akka.dispatch.Await;
|
||||
import static akka.Patterns.ask;
|
||||
import static akka.pattern.Patterns.ask;
|
||||
import akka.util.Duration;
|
||||
import akka.testkit.AkkaSpec;
|
||||
import akka.testkit.TestProbe;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import org.junit.Test;
|
|||
import scala.Option;
|
||||
import java.lang.Object;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import akka.Patterns;
|
||||
import akka.pattern.Patterns;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import akka.actor.UntypedActor;
|
|||
import akka.actor.ActorRef;
|
||||
import akka.actor.Props;
|
||||
import akka.dispatch.Futures;
|
||||
import akka.Patterns;
|
||||
import akka.pattern.Patterns;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import org.junit.Test;
|
|||
//#imports
|
||||
import akka.actor.*;
|
||||
import akka.dispatch.Await;
|
||||
import static akka.Patterns.ask;
|
||||
import static akka.pattern.Patterns.ask;
|
||||
import akka.transactor.Coordinated;
|
||||
import akka.util.Duration;
|
||||
import akka.util.Timeout;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
|||
|
||||
"using ask" in {
|
||||
//#using-ask
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
class MyActor extends Actor {
|
||||
def receive = {
|
||||
|
|
@ -245,7 +245,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
|||
//#using-implicit-timeout
|
||||
import akka.util.duration._
|
||||
import akka.util.Timeout
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
implicit val timeout = Timeout(500 millis)
|
||||
val future = myActor ? "hello"
|
||||
//#using-implicit-timeout
|
||||
|
|
@ -257,7 +257,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
|||
val myActor = system.actorOf(Props(new FirstActor))
|
||||
//#using-explicit-timeout
|
||||
import akka.util.duration._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
val future = myActor ? ("hello", timeout = 500 millis)
|
||||
//#using-explicit-timeout
|
||||
Await.result(future, 500 millis) must be("hello")
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val msg = "hello"
|
||||
//#ask-blocking
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
implicit val timeout = system.settings.ActorTimeout
|
||||
val future = actor ? msg // enabled by the “ask” import
|
||||
|
|
@ -59,7 +59,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
implicit val timeout = system.settings.ActorTimeout
|
||||
//#map-to
|
||||
import akka.dispatch.Future
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
val future: Future[String] = ask(actor, msg).mapTo[String]
|
||||
//#map-to
|
||||
|
|
@ -149,7 +149,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val msg2 = 2
|
||||
implicit val timeout = system.settings.ActorTimeout
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
//#composing-wrong
|
||||
|
||||
val f1 = ask(actor1, msg1)
|
||||
|
|
@ -173,7 +173,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val msg2 = 2
|
||||
implicit val timeout = system.settings.ActorTimeout
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
//#composing
|
||||
|
||||
val f1 = ask(actor1, msg1)
|
||||
|
|
@ -195,7 +195,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val oddActor = system.actorOf(Props[OddActor])
|
||||
//#sequence-ask
|
||||
// oddActor returns odd numbers sequentially from 1 as a List[Future[Int]]
|
||||
val listOfFutures = List.fill(100)(akka.patterns.ask(oddActor, GetNext).mapTo[Int])
|
||||
val listOfFutures = List.fill(100)(akka.pattern.ask(oddActor, GetNext).mapTo[Int])
|
||||
|
||||
// now we have a Future[List[Int]]
|
||||
val futureList = Future.sequence(listOfFutures)
|
||||
|
|
@ -243,7 +243,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val actor = system.actorOf(Props[MyActor])
|
||||
val msg1 = -1
|
||||
//#recover
|
||||
val future = akka.patterns.ask(actor, msg1) recover {
|
||||
val future = akka.pattern.ask(actor, msg1) recover {
|
||||
case e: ArithmeticException ⇒ 0
|
||||
}
|
||||
//#recover
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import annotation.tailrec
|
|||
import akka.actor.{ Props, Actor }
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
case class FibonacciNumber(nbr: Int)
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
import akka.testkit.TestActorRef
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
val actorRef = TestActorRef(new MyActor)
|
||||
// hypothetical message stimulating a '42' answer
|
||||
|
|
@ -204,7 +204,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
"demonstrate probe reply" in {
|
||||
import akka.testkit.TestProbe
|
||||
import akka.util.duration._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
//#test-probe-reply
|
||||
val probe = TestProbe()
|
||||
val future = probe.ref ? "hello"
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class TransactorDocSpec extends AkkaSpec {
|
|||
import akka.dispatch.Await
|
||||
import akka.util.duration._
|
||||
import akka.util.Timeout
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
val system = ActorSystem("app")
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import scala.annotation.tailrec
|
|||
import com.google.protobuf.ByteString
|
||||
import java.util.concurrent.TimeoutException
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
/**
|
||||
* Interface for node membership change listener.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import akka.routing._
|
|||
import akka.actor.{ Actor, Props }
|
||||
import akka.testkit._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object DirectRoutedRemoteActorMultiJvmSpec extends AbstractRemoteActorMultiJvmSpec {
|
||||
override def NrOfNodes = 2
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import akka.routing._
|
|||
import akka.testkit._
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object NewRemoteActorMultiJvmSpec extends AbstractRemoteActorMultiJvmSpec {
|
||||
override def NrOfNodes = 2
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import akka.remote._
|
|||
import akka.routing._
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object RandomRoutedRemoteActorMultiJvmSpec extends AbstractRemoteActorMultiJvmSpec {
|
||||
override def NrOfNodes = 4
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import akka.remote._
|
|||
import akka.routing._
|
||||
import akka.testkit.DefaultTimeout
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object RoundRobinRoutedRemoteActorMultiJvmSpec extends AbstractRemoteActorMultiJvmSpec {
|
||||
override def NrOfNodes = 4
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import akka.testkit._
|
|||
import akka.actor._
|
||||
import com.typesafe.config._
|
||||
import akka.dispatch.Await
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object RemoteCommunicationSpec {
|
||||
class Echo extends Actor {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.util.concurrent.atomic.AtomicLong
|
|||
import akka.event.EventStream
|
||||
import scala.collection.immutable.Stack
|
||||
import akka.dispatch._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
/**
|
||||
* This special ActorRef is exclusively for use during unit testing in a single-threaded environment. Therefore, it
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import akka.actor.DeadLetter
|
|||
import java.util.concurrent.TimeoutException
|
||||
import akka.dispatch.{ Await, MessageDispatcher }
|
||||
import akka.dispatch.Dispatchers
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object TimingTest extends Tag("timing")
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import akka.event.Logging.Warning
|
|||
import akka.dispatch.{ Future, Promise, Await }
|
||||
import akka.util.duration._
|
||||
import akka.actor.ActorSystem
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
/**
|
||||
* Test whether TestActorRef behaves as an ActorRef should, besides its own spec.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import org.scalatest.{ BeforeAndAfterEach, WordSpec }
|
|||
import akka.actor._
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.{ Await, Future }
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class TestProbeSpec extends AkkaSpec with DefaultTimeout {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import akka.actor.UntypedActor;
|
|||
import akka.actor.UntypedActorFactory;
|
||||
import akka.dispatch.Await;
|
||||
import akka.dispatch.Future;
|
||||
import static akka.Patterns.ask;
|
||||
import static akka.pattern.Patterns.ask;
|
||||
import akka.testkit.AkkaSpec;
|
||||
import akka.testkit.EventFilter;
|
||||
import akka.testkit.ErrorFilter;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import akka.actor.UntypedActor;
|
|||
import akka.actor.UntypedActorFactory;
|
||||
import akka.dispatch.Await;
|
||||
import akka.dispatch.Future;
|
||||
import static akka.Patterns.ask;
|
||||
import static akka.pattern.Patterns.ask;
|
||||
import akka.testkit.AkkaSpec;
|
||||
import akka.testkit.EventFilter;
|
||||
import akka.testkit.ErrorFilter;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import akka.util.duration._
|
|||
import akka.util.Timeout
|
||||
import akka.testkit._
|
||||
import scala.concurrent.stm._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object CoordinatedIncrement {
|
||||
case class Increment(friends: Seq[ActorRef])
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import akka.testkit.TestEvent.Mute
|
|||
import scala.concurrent.stm._
|
||||
import scala.util.Random.{ nextInt ⇒ random }
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object FickleFriends {
|
||||
case class FriendlyIncrement(friends: Seq[ActorRef], timeout: Timeout, latch: CountDownLatch)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import akka.util.duration._
|
|||
import akka.util.Timeout
|
||||
import akka.testkit._
|
||||
import scala.concurrent.stm._
|
||||
import akka.patterns.ask
|
||||
import akka.pattern.ask
|
||||
|
||||
object TransactorIncrement {
|
||||
case class Increment(friends: Seq[ActorRef], latch: TestLatch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue