{ def receive = { case "hello" => println("hello back at you") case _ => println("huh?") } } object Main extends App { val system = ActorSystem("HelloSystem") val helloActor = system.actorOf(Props[HelloActor], name="helloactor") helloActor ! "hello" helloActor ! "buenos dias" } 1 Classes, objects.. and actors 1 2 Overrides and all the Java/Scala stuff 2 3 Must explicitly create actor system 3 4 Actor creation 4
one type of mailbox, and it’s part of the actor. • No mailbox size limit. • Only physical limitations. • A process receives a message when it extracts it from the mailbox. • Order or reception is imposed by the receiving process.
change the message once it has been sent! • The mailbox is a different entity from the actor. • There are several out-of-the-box implementations of a mailbox. • Order of reception is determined by the semantics of the mailbox implementation.
means: • Preemptive scheduling. • No process can block other processes. • There are several schedulers (usually 1/processor). • Criteria for scheduling/preempting a process: • Priority • Reductions
Franz Kuhn atribuye a cierta enciclopedia china que se titula Emporio celestial de conocimientos benévolos. En sus remotas páginas está escrito que los animales se dividen en (a) pertenecientes al Emperador, (b) embalsamados, (c) amaestrados, (d) lechones, (e) sirenas, (f) fabulosos, (g) perros sueltos, (h) incluidos en esta clasificación, (i) que se agitan como locos, (j) innumerables, (k) dibujados con un pincel finísimo de pelo de camello, (1) etcétera, (m) que acaban de romper el jarrón, (n) que de lejos parecen moscas. El idioma analítico de John Wilkins Jorge Luis Borges, 1952
Scala compiler. • You can run it as a server. • But, once you run an application runs, the only way to stop it is to kill the whole JVM. • Multi-projects: • I don’t recommend using it. • Slows the build way further.
you’re stuck with a mainstream language, that may be a reasonable work around. It requires a significant degree of preplanning, and makes your application dependent on one more piece of machinery that has NOTHING to do with the actual problem the application is trying to solve. On the positive side, it helps guarantee employment for software engineers. That said, it’s important to understand that DIFs are just a work around for a deficiency in the underlying language.” Constructors Considered Harmful Gilad Bracha http://j.mp/ccharmful