score:-1

You don't need the channels. Try something like this:

react{
  case str: String => handleString(str)
  case i: Int => handleInt(i)
  case _ => println(this+": wrong message")
}

Obviously handleString and handleInt are some private function you should define.


Related Query

More Query from same tag