Akka 简介与入门
Akka 简介与入门
http://www.thinksaas.cn/group/topic/344095/
参考官网 http://akka.io/
开源代码 https://github.com/akka/akka
Slogan:
Build powerful concurrent &distributed applications more easily.
轻松构建健壮的并发和分布式应用
Akka是什么?
Akka is a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM.
Akka是一个在JVM上构建高并发、分布式和可快速恢复的消息驱动应用的工具集和运行时。
Akka特性
Simple Concurrency &Distribution 简单的并发和分布式
Asynchronous and Distributed by design. High-level abstractions like Actors, Futures and STM.
Resilient by Design 快速恢复设计
Write systems that self-heal. Remote and/or local supervisor hierarchies.
High Performance 高性能
50 million msg/sec on a single machine. Small memory footprint;~2.5 million actors per GB of heap.
Elastic &Decentralized 弹性和去中心化
Adaptive load balancing, routing, partitioning and configuration-driven remoting.
Extensible 可扩展
Use Akka Extensions to adapt Akka to fit your needs.
重要概念/术语
Actors
Actors are very lightweight concurrent entities. They process messages asynchronously using an event-driven receive loop. Pattern matching against messages is a convenient way to express an actor's behavior. They raise the abstraction level and make it much easier to write, test, understand and maintain concurrent and/or distributed systems. You focus on workflow—how the messages flow in the system—instead of low level primitives like threads, locks and socket IO.
Remoting
Actors are location transparent and distributable by design. This means that you can write your application without hardcoding how it will be deployed and distributed, and then later just configure your actor system against a certain topology with all of the application’s semantics, including actor supervision, retained.
Supervision
Actors form a tree with actors being parents to the actors they've created. As a parent, the actor is responsible for handling its children’s failures (so-called supervision), forming a chain of responsibility, all the way to the top. When an actor crashes, its parent can either restart or stop it, or escalate the failure up the hierarchy of actors. This enables a clean set of semantics for managing failures in a concurrent, distributed system and allows for writing highly fault-tolerant systems that self-heal.
中文资料
基于AKKA的后台应用开发手册
Akka分片集群的实现
使用Akka的Actor和Future简单地实现并发处理
http://www.th7.cn/Program/java/2012/03/29/67015.shtml
Java中使用akka手记一
http://2014.54chen.com/blog/2014/04/14/how-to-use-akka-in-java/
示例代码
public class Greeting implements Serializable {public final String who;public Greeting(String who) {this.who=who;}}public class GreetingActor extends UntypedActor {LoggingAdapter log=Logging.getLogger(getContext().system(), this);public void onReceive(Object message) throws Exception {if (message instanceof Greeting) log.info("Hello " + ((Greeting) message).who);}}ActorSystem system=ActorSystem.create("MySystem");ActorRef greeter=system.actorOf(Props.create(GreetingActor.class), "greeter");greeter.tell(new Greeting("Charlie Parker"), ActorRef.noSender());
Akka 简介与入门的更多相关文章
- JS面向对象(1) -- 简介,入门,系统常用类,自定义类,constructor,typeof,instanceof,对象在内存中的表现形式
相关链接: JS面向对象(1) -- 简介,入门,系统常用类,自定义类,constructor,typeof,instanceof,对象在内存中的表现形式 JS面向对象(2) -- this的使用,对 ...
- python3-day1-python简介及入门
python简介及入门 python简介 Python的创始人为Guido van Rossum.1989年圣诞节期间,在阿姆斯特丹,Guido为了打发圣诞节的无趣,决心开发一个新的脚本解释程序,做为 ...
- Robot Framework-工具简介及入门使用
Robot Framework-Mac版本安装 Robot Framework-Windows版本安装 Robot Framework-工具简介及入门使用 Robot Framework-Databa ...
- Linux内核学习笔记-1.简介和入门
原创文章,转载请注明:Linux内核学习笔记-1.简介和入门 By Lucio.Yang 部分内容来自:Linux Kernel Development(Third Edition),Robert L ...
- 【转】Docker简介与入门
转自:https://segmentfault.com/a/1190000000448808 Docker是个新生的事物,概念类似虚拟化.网上关于Docker入门的东西已经很多了.不过本文探讨了Doc ...
- Quartz入门例子简介 从入门到菜鸟(一)
转: Quartz入门例子简介 从入门到菜鸟(一) 2016年11月19日 22:58:24 爱种鱼的猫 阅读数:4039 刚接触quartz这个词并不是在学习过程中...而是WOW里面的界面插件 ...
- [转] AKKA简介
[From] https://blog.csdn.net/linuxarmsummary/article/details/79399602 Akka in JAVA(一) AKKA简介 什么是AKKA ...
- Lombok简介及入门使用 (转载)
Lombok简介及入门使用 lombok既是一个IDE插件,也是一个项目要依赖的jar包. Intellij idea开发的话需要安装Lombok plugin,同时设置 Setting -> ...
- Shiro简介、入门案例、web容器的集成
目的: shiro简介 Shiro入门案例 Shiro与web容器的集成 shiro简介(中文官网:https://www.w3cschool.cn/shiro/andc1if0.html) 1.什么 ...
随机推荐
- 在html中禁用自己主动完毕
输入框输入内容时总是显示历史输入历史记录,现禁用的方法是加入一个属性: <input type="text name="txt_xm" autocomplete=& ...
- 二叉树的建立与遍历(山东理工OJ)
题目描写叙述 已知一个按先序序列输入的字符序列,如abc,,de,g,,f,,,(当中逗号表示空节点).请建立二叉树并按中序和后序方式遍历二叉树,最后求出叶子节点个数和二叉树深度. 输入 输入一个长度 ...
- Microsoft Build 2016 Day 2
Microsoft Build 2016 Day 2 Microsoft Build 2016 Day 1 记录 Microsoft Build 2016 进行到了第二天,我觉得这一天的内容非常精彩, ...
- ORACLE 中的 锁 介绍
ORACLE 中的 锁 介绍 Oracle数据库支持多个用户同时与数据库进行交互,每个用户都可以同时运行自己的事务,从而也需要对并发访问进行控制.Oracle也是用“锁”的机制来防止各个事务之间的相互 ...
- C语言 cgi(3)
1cs3157 – Advanced ProgrammingSummer 2014, Project 1, 150 pointsJune 17, 2014Follow these step-by-st ...
- javascript - 浏览TOM大叔博客的学习笔记
part1 ---------------------------------------------------------------------------------------------- ...
- 关于产品的一些思考——腾讯之QQ音乐
--------------------2014.5.11-------------------- 原来一直使用小米手机自带的音乐播放器,除了搜歌下载不方便,其它的还好(省电是最大的长处),用过Jin ...
- 【原创】poj ----- 3009 curling 2 解题报告
题目地址: http://poj.org/problem?id=3009 题目内容: Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Tot ...
- UVA - 10118Free Candies(记忆化搜索)
题目:UVA - 10118Free Candies(记忆化搜索) 题目大意:给你四堆糖果,每一个糖果都有颜色.每次你都仅仅能拿随意一堆最上面的糖果,放到自己的篮子里.假设有两个糖果颜色同样的话,就行 ...
- 选择排序java
先简述选择排序,然后上代码 进行选择排序就是将所有的元素扫描一遍,从中挑选(或者说是选择,这正是这个排序名字的由来)最小的一个元素,将这个最小的元素与最左边的元素交换位置 ,现在最左边的元素就是有序的 ...