blob: 05e3c08958301ad2f3174db573b4a7ed8e6ed352 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package examples.actors
import scala.actors.Actor._
import scala.actors.Channel
object Input extends Application {
var in = new Channel[Pair[int, int]]
actor(in) {
in.receive {
case Pair(x, y) => reply(x + y)
}
}
actor {
scala.Console.println(in !? Pair(40, 2))
}
}
|