Akka(1)Introduction

本文详细介绍了Akka的设计理念,包括并发、容错和可扩展性实现,着重讨论了Actor模型、事件驱动编程、轻量级进程、远程调用、事务处理等功能,并提供了安装指南及常见组件介绍。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Akka(1)Introduction
1. Introduction
1.1 What is Akka?
Design to write correct concurrent, fault-tolerant and scalable applications.

Akka implements a unique hybrid
Actors

Simple and high-level abstractions for concurrency and parallelism.
Asynchronous, non-blocking and highly performant event-driven programming model.
lightweight event-driven processes, 2.7 million actors per GB RAM

Scala documents: http://doc.akka.io/docs/akka/2.1.0/scala/actors.html#actors-scala

Fault Tolerance
Fault handling in Practice for scala
http://doc.akka.io/docs/akka/2.1.0/scala/fault-tolerance.html#fault-tolerance-scala

Location Transparency
All interactions of actors use pure message passing and everything is asynchronous.
http://doc.akka.io/docs/akka/2.1.0/general/remoting.html#remoting

Transactors
transactors combine actors and Software Transactional Memory(STM) into transactional actors.
http://doc.akka.io/docs/akka/2.1.0/scala/transactors.html#transactors-scala

Scala APIs
http://doc.akka.io/docs/akka/2.1.0/scala/index.html#scala-api

Akka can be used in 2 different ways
As a library in WEB-INF/lib

As a microkernel, stand-alone kernel
http://doc.akka.io/docs/akka/2.1.0/scala/microkernel.html#microkernel-scala

1.2. Why Akka?
…snip...

1.3 Getting Started
Getting Started Guides and Template Projects
Install Typesafe Stack
Follow the document here: http://typesafe.com/stack/download-agreed
Install scala, set, maven and giter8. But I already have all of them except giter8.
>sudo port install giter8

And download the file from here http://downloads.typesafe.com/typesafe-stack/2.0.2/typesafe-stack-2.0.2.tgz
Unzip and place in working directory.

I already have all the tools, so I do not need type safe stack bin, I just will go through the example.

Visit this page, you can find all the examples:
https://github.com/typesafehub

Modules
akka-actor Classic Actors, Typed Actors, IO Actor etc.
akka-remote Remote Actors
akka-testkit
akka-kernel Akka microkernel for running a bare-bones mini application server
akka-transactor Transactional actors
akka-agent
akka-camel
akka-zeromq ZeroMQ integration
akka-slf4j
akka-filebased-mailbox

Using a release distribution
Download the file from here: http://typesafe.com/stack/downloads/akka

Using with sbt
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"com.typesafe.akka" %% "akka-actor" % "2.1.0",
"com.typesafe.akka" %% "akka-testkit" % "2.1.0",
"com.typesafe.akka" %% "akka-transactor" % "2.1.0",

How can I use and deploy Akka
…snip…

References:
http://akka.io/
http://doc.akka.io/docs/akka/2.1.0/
http://typesafe.com/resources/tutorials/getting-started-with-akka-scala.html#getting-started-with-akka-scala
https://github.com/typesafehub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值