Skip to content

Commit e20e178

Browse files
author
mdodsworth
committed
simple message passing
1 parent ee0aafe commit e20e178

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

actors-messaging.scala

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import scala.actors.Actor
2+
import scala.actors.Actor._
3+
4+
val fussyActor = actor {
5+
loop {
6+
receive {
7+
case s:String => println("this is a test")
8+
case i:Int => println("int case: "+i)
9+
case _ => println("default case")
10+
}
11+
}
12+
}
13+
14+
fussyActor ! "testing"
15+
fussyActor ! 3

0 commit comments

Comments
 (0)