Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subscript.DSL._
- import subscript.Predef._
- import subscript.vm._
- import subscript._
- import subscript.swing.Scripts._
- import akka.actor._
- object Test {
- class Ping(another: ActorRef) extends Actor {
- override def receive: PartialFunction[Any, Unit] = {case _ =>}
- another ! "Hello"
- another ! "Hello"
- another ! "Terminal"
- }
- class Pong extends SubScriptActor {
- def script live = ((receiveRegular ...) || receiveTerminal) ; over
- def script receiveRegular =
- @{
- val r: Actor.Receive = {
- case "Hello" => println("Hello")
- }
- initActor(there, r)
- }: {. .}
- def script receiveTerminal =
- @{
- val r: Actor.Receive = {
- case "Terminal" => println("Terminal")
- }
- initActor(there, r)
- }: {. .}
- def script over = {println("Over")}
- }
- def main(args: Array[String]) {
- val as = ActorSystem()
- val pong = as actorOf Props[Pong]
- val ping = as actorOf Props(classOf[Ping], pong)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement