diff options
author | Philipp Haller <hallerp@gmail.com> | 2006-07-14 12:44:35 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2006-07-14 12:44:35 +0000 |
commit | 9d95c090f440956f856468dc59bdfd0ff560314b (patch) | |
tree | 82321355c0bef6f2c495fa30caa1b73331673d88 /docs/examples/actors/counter.scala | |
parent | 56c803d9c5b784d41e4d14b41d18d361e5830b31 (diff) | |
download | scala-9d95c090f440956f856468dc59bdfd0ff560314b.tar.gz scala-9d95c090f440956f856468dc59bdfd0ff560314b.tar.bz2 scala-9d95c090f440956f856468dc59bdfd0ff560314b.zip |
Updated actor examples.
Diffstat (limited to 'docs/examples/actors/counter.scala')
-rw-r--r-- | docs/examples/actors/counter.scala | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/docs/examples/actors/counter.scala b/docs/examples/actors/counter.scala index 1224853432..e768a8f9ef 100644 --- a/docs/examples/actors/counter.scala +++ b/docs/examples/actors/counter.scala @@ -1,17 +1,15 @@ /** * @author Philipp Haller <philipp.haller@epfl.ch> - * */ package examples.actors -import scala.actors.multi.Pid +import scala.actors.Process import scala.actors.distributed.{RemoteActor,TCP,TcpNode,TcpService} -abstract class CounterMessage -case class Incr() extends CounterMessage -case class Value(p: Pid) extends CounterMessage -case class Result(v: int) extends CounterMessage +case class Incr() +case class Value(p: Process) +case class Result(v: int) class Counter extends RemoteActor { override def run(): unit = @@ -39,7 +37,7 @@ class CounterUser extends RemoteActor { spawn(TcpNode(host, 9090), classOf[Counter].getName()) receive { - case p: Pid => + case p: Process => // communicate with counter Console.println("" + node + ": Sending Incr() to remote Counter (" + p + ")...") p ! Incr() |