diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-10-30 15:17:05 -0400 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-11-01 10:45:03 -0400 |
commit | c9efa2f6cf9fcfff00a29aeae5b400aaf5518e32 (patch) | |
tree | b919a9847113296ba05e27352788fdee277a7131 | |
parent | 79087c79c402ababbb50fa9d1e4e78b0e52189c6 (diff) | |
download | scala-c9efa2f6cf9fcfff00a29aeae5b400aaf5518e32.tar.gz scala-c9efa2f6cf9fcfff00a29aeae5b400aaf5518e32.tar.bz2 scala-c9efa2f6cf9fcfff00a29aeae5b400aaf5518e32.zip |
Removing actors-migration from main repository so it can live on elsewhere.
* Removes actors-migration hooks from partest
* Removes actors-migration code
* removes actors-migration tests
* removes actors-migration distribution packaging.
-rw-r--r-- | project/Testing.scala | 4 | ||||
-rw-r--r-- | src/actors/scala/actors/ActorRef.scala | 74 | ||||
-rw-r--r-- | test/files/jvm/actmig-remote-actor-self.check | 1 | ||||
-rw-r--r-- | test/files/jvm/actmig-remote-actor-self.scala | 34 |
4 files changed, 2 insertions, 111 deletions
diff --git a/project/Testing.scala b/project/Testing.scala index cec1d8c60b..5de72116a3 100644 --- a/project/Testing.scala +++ b/project/Testing.scala @@ -29,12 +29,12 @@ trait Testing { self: ScalaBuild.type => val testsuite = ( Project("testsuite", file(".")) settings (testsuiteSettings:_*) - dependsOn (scalaLibrary, scalaCompiler, fjbg, partest, scalacheck, actorsMigration) + dependsOn (scalaLibrary, scalaCompiler, fjbg, partest, scalacheck) ) val continuationsTestsuite = ( Project("continuations-testsuite", file(".")) settings (continuationsTestsuiteSettings:_*) - dependsOn (partest, scalaLibrary, scalaCompiler, fjbg, actorsMigration) + dependsOn (partest, scalaLibrary, scalaCompiler, fjbg) ) } diff --git a/src/actors/scala/actors/ActorRef.scala b/src/actors/scala/actors/ActorRef.scala index cca78b0832..5c1790669b 100644 --- a/src/actors/scala/actors/ActorRef.scala +++ b/src/actors/scala/actors/ActorRef.scala @@ -2,8 +2,6 @@ package scala.actors import java.util.concurrent.TimeoutException import scala.concurrent.duration.Duration -import scala.concurrent.Promise -import scala.concurrent.ExecutionContext.Implicits.global /** * Trait used for migration of Scala actors to Akka. @@ -43,78 +41,6 @@ trait ActorRef { } -private[actors] class OutputChannelRef(val actor: OutputChannel[Any]) extends ActorRef { - - override private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any] = - throw new UnsupportedOperationException("Output channel does not support ?") - - /** - * Sends a one-way asynchronous message. E.g. fire-and-forget semantics. - * <p/> - * - * <p/> - * <pre> - * actor ! message - * </pre> - * <p/> - */ - def !(message: Any)(implicit sender: ActorRef = null): Unit = - if (sender != null) - actor.send(message, sender.localActor) - else - actor ! message - - override def equals(that: Any) = - that.isInstanceOf[OutputChannelRef] && that.asInstanceOf[OutputChannelRef].actor == this.actor - - private[actors] override def localActor: AbstractActor = - throw new UnsupportedOperationException("Output channel does not have an instance of the actor") - - def forward(message: Any): Unit = throw new UnsupportedOperationException("OutputChannel does not support forward.") - -} - -private[actors] class ReactorRef(override val actor: Reactor[Any]) extends OutputChannelRef(actor) { - - /** - * Forwards the message and passes the original sender actor as the sender. - * <p/> - * Works with '!' and '?'. - */ - override def forward(message: Any) = actor.forward(message) - -} - -private[actors] final class InternalActorRef(override val actor: InternalActor) extends ReactorRef(actor) { - - /** - * Sends a message asynchronously, returning a future which may eventually hold the reply. - */ - override private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any] = { - val dur = if (timeout.isFinite()) timeout.toMillis else (java.lang.Long.MAX_VALUE >> 2) - val replyPromise = Promise[Any] - scala.concurrent.future { - scala.concurrent.blocking { - actor !? (dur, message) - } match { - case Some(x) => replyPromise success x - case None => replyPromise failure new AskTimeoutException("? operation timed out.") - } - } - replyPromise.future - } - - override def !(message: Any)(implicit sender: ActorRef = null): Unit = - if (message == PoisonPill) - actor.stop('normal) - else if (sender != null) - actor.send(message, sender.localActor) - else - actor ! message - - private[actors] override def localActor: InternalActor = this.actor -} - /** * This is what is used to complete a Future that is returned from an ask/? call, * when it times out. diff --git a/test/files/jvm/actmig-remote-actor-self.check b/test/files/jvm/actmig-remote-actor-self.check deleted file mode 100644 index 79d23cb337..0000000000 --- a/test/files/jvm/actmig-remote-actor-self.check +++ /dev/null @@ -1 +0,0 @@ -registered diff --git a/test/files/jvm/actmig-remote-actor-self.scala b/test/files/jvm/actmig-remote-actor-self.scala deleted file mode 100644 index 2b994f6081..0000000000 --- a/test/files/jvm/actmig-remote-actor-self.scala +++ /dev/null @@ -1,34 +0,0 @@ -/** - * NOTE: Code snippets from this test are included in the Actor Migration Guide. In case you change - * code in these tests prior to the 2.10.0 release please send the notification to @vjovanov. - */ -import scala.actors._ -import scala.actors.migration._ -import scala.actors.remote._ -import scala.actors.remote.RemoteActor._ -import scala.concurrent._ -import scala.concurrent.duration._ - -object Test { - val finished = Promise[Boolean] - - def main(args: Array[String]): Unit = { - - // can fail with class cast exception in alive - val myAkkaActor = ActorDSL.actor(new StashingActor { - override def preStart() = { - alive(42013) - println("registered") - finished success true - context.stop(self) - } - - def receive = { - case x: Int => - } - }) - - Await.result(finished.future, Duration.Inf).toString - } - -} |