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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -