summaryrefslogblamecommitdiff
path: root/test/files/jvm/replyreactor.scala
blob: fb915cf3f94b9560c7e9a71770830f9990076cfc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
                                












                                 
                              

                 
                                 












                            
import scala.actors.ReplyReactor

object Test {
  def main(args: Array[String]) {
    val a = new ReplyReactor {
      def act() {
        react {
          case 'hello =>
            sender ! 'hello
        }
      }
    }
    a.start()

    val b = new ReplyReactor {
      def act() {
        react {
          case r: ReplyReactor =>
            r ! 'hello
            react {
              case any =>
                println(any)
            }
        }
      }
    }
    b.start()

    b ! a
  }
}