diff options
Diffstat (limited to 'docs/examples/actors/RemoteCounter.scala')
-rw-r--r-- | docs/examples/actors/RemoteCounter.scala | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/docs/examples/actors/RemoteCounter.scala b/docs/examples/actors/RemoteCounter.scala deleted file mode 100644 index 004d96ba9a..0000000000 --- a/docs/examples/actors/RemoteCounter.scala +++ /dev/null @@ -1,40 +0,0 @@ -package examples.actors - -import scala.actors.Actor._ -import scala.actors.Actor -import scala.actors.remote.Node -import scala.actors.remote.RemoteActor._ - -case object Incr -case object Value -case class Result(v: int) - -object RemoteCounter extends Application { - actor { - def loop(value: int): unit = { - Console.println("Value: " + value) - receive { - case Incr => loop(value + 1) - case Value => { sender ! Result(value); loop(value) } - case other => loop(value) - } - } - - alive(9010) - register('counter, self) - loop(0) - } - - actor { - val c = select(Node("127.0.0.1", 9010), 'counter) - c ! Incr - c ! Incr - c ! Value - receive { - case Result(v) => { - Console.println("Received result: " + v) - sender ! Incr - } - } - } -} |