摘要: Actor Path我们知道actor是有层级的(hierarchical),第、每个actor在它的父actor的名字空间下都有一个名字。这样就构成了一个树状的结构,就像是文件系统。每个actor就像文件系统里的一个文件夹,因为每个actor都可以有子actor,因此,它们更像是文件夹,而不是文件... 阅读全文
posted @ 2014-12-22 16:56 devos 阅读(405) 评论(0) 推荐(0) 编辑
摘要: week7中的前两节课的标题是”Actors are Distributed",讲了很多Akka Cluster的内容,同时也很难理解。Roland Kuhn并没有讲太多Akka Cluster自身如何工作的细节,而是更关注于如何利用Akka Cluster来把Actor分布到不同的节点上,或许这么... 阅读全文
posted @ 2014-12-18 17:40 devos 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 下面的内容大多是翻译来的。Reactive Programming?What is Reactive Programming?为了了解Reactive——从编程范式至其背后的动机,有必要了解现在的开发者和公司在十年前不曾面对的挑战。游戏的改变主要有两大方面:硬件的提升因特网Why things ar... 阅读全文
posted @ 2014-12-18 15:13 devos 阅读(4909) 评论(0) 推荐(1) 编辑
摘要: 这是《Pinciples of Reactive Programming》week6的最后一课。为什么需要把actor的状态持久化?如果actor没有状态,那么在任何实时,这个actor的行为都是一致的。但是对于有状态的actor,其行为跟当前状态相关。所以当系统由于意外down掉以后,需要恢复系统... 阅读全文
posted @ 2014-12-12 14:58 devos 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 在课程里Week3的一节 "Promises, promises, promises"中,Erik Meijer举了一个例子,实现一个函数:def sequence[T](fs: List[Future[T]]): Future[List[T]] = {.....}这个函数实际在Scala libr... 阅读全文
posted @ 2014-11-25 14:19 devos 阅读(1598) 评论(0) 推荐(0) 编辑
摘要: IDEA的版本是14.0.1,运行在MAC OS X Yosemite上。IDEA已经装了Scala插件,但是在新建工程中,Scala的选项中并没有Play框架,不知道什么原因。导入Play工程我想导入从Github上下载的一个play工程。当直接用IDEA的import project导入buil... 阅读全文
posted @ 2014-11-21 09:44 devos 阅读(1560) 评论(0) 推荐(0) 编辑
摘要: 参考自http://stackoverflow.com/questions/19478244/how-does-a-case-anonymous-function-really-work-in-scalahttp://www.scala-lang.org/files/archive/nightly/... 阅读全文
posted @ 2014-11-19 14:34 devos 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 要想容错,该怎么办?父actor首先要获知子actor的失败状态,然后确定该怎么办, “怎么办”这回事叫做“supervisorStrategy"。 // Restart the storage child when StorageException is thrown. // After 3 re... 阅读全文
posted @ 2014-07-01 16:02 devos 阅读(892) 评论(0) 推荐(0) 编辑
摘要: Manifest和TypeTag是要解决什么问题?As with other JVM languages, Scala’s types are erased at compile time. This means that if you were to inspect the runtime typ... 阅读全文
posted @ 2014-06-23 22:14 devos 阅读(1019) 评论(0) 推荐(0) 编辑
摘要: 当Kafka启动时,会启动这个SocketServer来接收客户端的连接,处理客户端请求,发送响应。这个类的注释说明了这个socket server的结构/** * An NIO socket server. The threading model is * 1 Acceptor thread ... 阅读全文
posted @ 2014-06-10 20:41 devos 阅读(974) 评论(0) 推荐(0) 编辑