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.什么 ...
随机推荐
- C++ Primer笔记10_运算符重载_赋值运算符_进入/输出操作符
1.颂值运营商 首先来福值运算符引入后面要说的运算符重载.上一节说了构造函数.拷贝构造函数:一个类要想进行更好的控制.须要定义自己的构造函数.拷贝构造函数.析构函数.当然,还有赋值运算符.常说的三大函 ...
- Visual Studio跨平台开发实战(3) - Xamarin iOS多页面应用程式开发
原文 Visual Studio跨平台开发实战(3) - Xamarin iOS多页面应用程式开发 前言 在前一篇教学中, 我们学会如何使用Visual Studio 搭配Xcode 进行iOS基本控 ...
- [Network]Application Layer
1 Principles of Network Applications 1.1 Application Architectures Client-Server Peer-to-Peer Hybird ...
- POJ 1002 487-3279 Trie解读
这个问题的解决方法是多种多样的.如本文所用,Trie为了解决这个问题. 它也可用于hash表.map等解决方案,由于输入是特定7数字,因此,你应该能够解决. 如本文所用,Trie不是非常快.最后,我主 ...
- Composite Design Pattern 设计模式组合
设计模式组合,它能够更类组合在一类,形成一个树状结构. #include <set> #include <iostream> #include <string> u ...
- mysql寻呼最快
大家都知道,mysql分页写: select * from 'yourtable' limit start,rows 如今我数据库一张表里面有9969W条数据.表名叫tweet_data select ...
- HSQL
Whenever I connect to HSQLDB from my application deployed on eclipse Juno, it throws an exception as ...
- ubuntu10.10和windows双系统启动顺序的修改
我想大部分童鞋装ubuntu的时候,硬盘上的windows肯定还是保留着的,启动电 脑时可以选择,想进windows就进windows,想进ubuntu就进ubuntu.但装完ubuntu后,它默认启 ...
- 泛泰A860 Andorid4.4.3 KTU84M (Omni) 图赏
Omni4.4.3 For Pantech A860L/K/S watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc3lob3N0/font/5a6L5L2T/ ...
- 【UVA272】TEX Quotes
A - TEX Quotes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submitcid=80 ...