scala - AKKA receive reference to message -
in java declaration of onreceive includes reference message object.
public void onreceive( object message ) { if( message instanceof myclass ) {
in scala no such reference included , cases specific
def receive { case "test" => println("ttt") }
is there way access received message in scala? like, example, manually forward unknown messages specific actor. like
def receive { case "test" => println("ttt") case _ => anotheractor ! themessage }
yes, amazingly simple:
def receive { case "test" => println("ttt") case themessage => anotheractor ! themessage }
Comments
Post a Comment