summaryrefslogtreecommitdiff
path: root/test/files/jvm/actmig-PinS_2.scala
diff options
context:
space:
mode:
authorphaller <hallerp@gmail.com>2012-09-29 18:15:37 +0200
committerphaller <hallerp@gmail.com>2012-09-29 18:19:52 +0200
commitb2211a76a6e537cf2e404d424cb643f171818e92 (patch)
tree0fde859c45025594b7205cffe1c29fc37bf9b483 /test/files/jvm/actmig-PinS_2.scala
parentbe49f36154efa78c3dcbeba394aa6ec2b5e764ec (diff)
downloadscala-b2211a76a6e537cf2e404d424cb643f171818e92.tar.gz
scala-b2211a76a6e537cf2e404d424cb643f171818e92.tar.bz2
scala-b2211a76a6e537cf2e404d424cb643f171818e92.zip
SI-6442 - Add ActorDSL object for actor migration kit
Removes MigrationSystem, since ActorDSL replaces it.
Diffstat (limited to 'test/files/jvm/actmig-PinS_2.scala')
-rw-r--r--test/files/jvm/actmig-PinS_2.scala23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/files/jvm/actmig-PinS_2.scala b/test/files/jvm/actmig-PinS_2.scala
index 7d12578f71..508525463f 100644
--- a/test/files/jvm/actmig-PinS_2.scala
+++ b/test/files/jvm/actmig-PinS_2.scala
@@ -9,7 +9,7 @@ import scala.concurrent.{ Promise, Await }
object SillyActor {
val startPromise = Promise[Boolean]()
- val ref = MigrationSystem.actorOf(Props(() => new SillyActor, "default-stash-dispatcher"))
+ val ref = ActorDSL.actor(new SillyActor)
}
/* PinS, Listing 32.1: A simple actor
@@ -29,7 +29,7 @@ class SillyActor extends StashingActor {
object SeriousActor {
val startPromise = Promise[Boolean]()
- val ref = MigrationSystem.actorOf(Props(() => new SeriousActor, "default-stash-dispatcher"))
+ val ref = ActorDSL.actor(new SeriousActor)
}
class SeriousActor extends StashingActor {
@@ -44,7 +44,7 @@ class SeriousActor extends StashingActor {
/* PinS, Listing 32.3: An actor that calls react
*/
object NameResolver {
- val ref = MigrationSystem.actorOf(Props(() => new NameResolver, "default-stash-dispatcher"))
+ val ref = ActorDSL.actor(new NameResolver)
}
class NameResolver extends StashingActor {
@@ -80,7 +80,7 @@ object Test extends App {
/* PinS, Listing 32.2: An actor that calls receive
*/
- def makeEchoActor(): ActorRef = MigrationSystem.actorOf(Props(() =>
+ def makeEchoActor(): ActorRef = ActorDSL.actor(
new StashingActor {
def receive = { case _ => println("Nop") }
@@ -94,11 +94,11 @@ object Test extends App {
}
}
}
- }, "default-stash-dispatcher"))
+ })
/* PinS, page 696
*/
- def makeIntActor(): ActorRef = MigrationSystem.actorOf(Props(() =>new StashingActor {
+ def makeIntActor(): ActorRef = ActorDSL.actor(new StashingActor {
def receive = { case _ => println("Nop") }
@@ -108,9 +108,9 @@ object Test extends App {
println("Got an Int: " + x)
}
}
- }, "default-stash-dispatcher"))
+ })
- MigrationSystem.actorOf(Props(() => new StashingActor {
+ ActorDSL.actor(new StashingActor {
def receive = { case _ => println("Nop") }
@@ -126,7 +126,7 @@ object Test extends App {
case Exit(_: SeriousActor, _) =>
val seriousPromise2 = Promise[Boolean]()
// PinS, page 694
- val seriousActor2 = MigrationSystem.actorOf(Props(() =>{
+ val seriousActor2 = ActorDSL.actor(
new StashingActor {
def receive = { case _ => println("Nop") }
@@ -136,8 +136,7 @@ object Test extends App {
println("That is the question.")
seriousPromise2.success(true)
}
- }
- }, "default-stash-dispatcher"))
+ })
Await.ready(seriousPromise2.future, 5 seconds)
val echoActor = makeEchoActor()
@@ -156,5 +155,5 @@ object Test extends App {
}
}
}
- }, "default-stash-dispatcher"))
+ })
}