I am trying to see, how does Scala pattern match what type of Actor Event is happening, for example whether the event is a send event, receive event, function call event, etc.
Is it possible to have a form of match statement trying to check whether Scala matches a send event, … i.e. Is it possible to write something like this :
act match {
case (A ! a) => print “send event read”
case ( A receive message) => print " receive event read"
case (function_name(params)) => print “function call read”
case _ => “No event read”
}
When you’re talking about events and Actors, you’re probably talking about Akka (which is not the main interest of this forum, but hey).
When using Akka (and even more so when using typed Actors), you define the types of messages an Actor reacts on usually as a sealed class hierarchy. You seem to want react on anything being thrown at an Actor, which is not what is done usually.
Please try asking specific questions and to describe the problem you’re trying to solve; rather than half-heartedly throwing something together nobody can really make sense of.