The Actor is the unit of execution in Akka. Actors are object-oriented in the sense that they encapsulate state and behavior, but they have much stronger isolation than regular objects in Java or Scala. The Actor model prevents sharing state between…
Define Constraints That Are Minimal and Sufficient 设定不多不少的约束 今天第二章第二节. 主管不在,然后暂时没什么任务,把第二节看了,然后整理一下,下班之后就能继续去打球了. 标题翻译是,设定不多不少的约束,(好像有点过于通俗了).关键是何为不多不少. 这里有个没意义的约束: 定义一个Object约束确实没意义,你能想出有什么意义吗?既然如此,编译器就直接不让过了. 再做个测试. 定义一个Person类. public class Pers…
So far we have defined our Actor and its messages. Now let's create an instance of this actor. In Akka you can't create an instance of an Actor the regular way using new, instead you create it using a factory. 在Akka中你無法使用new創建Actor的實例, 而是使用工廠創建它. Wha…
An Actor does not have a public API in terms of methods that you can invoke. Instead its public API is defined through messages that the actor handles. Actor沒有一個你可以調用的公用API方法的術語, 而是它的公用API是被定義通過Actor處理信息 Messages can be of arbitrary type (any subtype…
原文:http://rerun.me/2014/10/21/akka-notes-child-actors-and-path/ Actor是完全的继承结构.你创建的任何Actor肯定都是一个其他Actor的child. 让我们分析下: PATH 我们用ActorSystem.actorof创建一个ActorRef并打印出他的path val actorSystem=ActorSystem("SupervisionActorSystem") val actorRef=actorSyste…
今日在看一个第三方代码时看到了#define for if(false);else for 这样的一种定义,不明白这样用法的目的,于是查了一下. 这是一个兼容vc6.0的用法,csdn上有这个问题的回答http://bbs.csdn.net/topics/40398205 因为自从毕业以后就几乎没接触过vc6了,还真不知道有这么一回事,vc6中 for表达式的作用域居然违背了c++标准. 如: for (int i = 0 ; i < 5; i++) { cout << i; } i =…