Actor 开发模型库,Akka 2.4 RC1 发布

jopen 9年前

Akka 是一个用 Scala 编写的库,用于简化编写容错的、高可伸缩性的 Java 和 Scala 的 Actor 模型应用。

Actor模型并非什么新鲜事物,它由Carl Hewitt于上世纪70年代早期提出,目的是为了解决分布式编程中一系列的编程问题。其特点如下:

  • 系统中的所有事物都可以扮演一个Actor

  • Actor之间完全独立

  • 在收到消息时Actor所采取的所有动作都是并行的,在一个方法中的动作没有明确的顺序

  • Actor由标识和当前行为描述

  • Actor可能被分成原始(primitive)和非原始(non primitive)类别

  • 非原始Actor有

    • 由一个邮件地址表示的标识

    • 当前行为由一组知识(acquaintances)(实例变量或本地状态)和定义Actor在收到消息时将采取的动作组成

  • 消息传递是非阻塞和异步的,其机制是邮件队列(mail-queue)

  • 所有消息发送都是并行的

Akka 2.4 RC1 发布,相比最后一个 M 版本,主要改进如下:

Akka 2.4.0 主要改进如下:

  • we dropped support for Java 6 & 7 as announced in the last roadmap update, and now require Java 8 or later

  • we dropped support for Scala 2.10, kept 2.11 and added 2.12 (which is at milestone 2 currently); this is in keeping with our policy to support the Scala version that is “current” when the first milestone comes out plus any later version that is published during this series’ lifetime

  • Akka Persistence was promoted to a fully supported module (not experimental)

  • added experimental stream based API for the Query Side of Akka Persistence (implementations must be provided by query plugins corresponding to the journal plugins for the various data stores)

  • improved support for Akka Persistence event migrations by Serializer with String Manifest and Event Adapters and prepared comprehensive documentation of strategies for schema evolution of persistent events

  • made Akka Persistence failure handling more robust and support rejections of events

  • Akka Persistence can now use multiple different Journals within one ActorSystem (thanks to Andrei Pozolotin, who also split out ClusterMetrics into their own module)

  • introduced Persistent FSM, thanks to an awesome contribution from leonidb

  • simplified setting up Akka Clusters behind NAT (including inside Docker containers)

  • we added the experimental Akka Typed module previously codenamed Project Gålbma, a new way of formulating Actor interactions with full type-system support

  • we promoted the ClusterSingleton, ClusterClient, DistributedPubSub and ClusterSharding patterns to fully a supported Cluster Tools module, including various API and configuration improvements

  • ClusterSharding also learnt a few new tricks (graceful shutdown, asynchronous shard allocation, reviving entries after migration thanks to Dominic Black, and more flexible use of roles [thanks to Richard Marscher)

  • use custom failure detection in ClusterClient to avoid quarantining in case of transient network failures

  • added experimental Akka Distributed Data which was previously known as Akka Data Replication (see akka-data-replication migration guide), the Distributed Data module is useful for sharing eventually consistent data (CRDTs) between nodes in an Akka Cluster

  • the SLF4J logging adapter can now apply the log filtering rules prior to sending to the EventStream, see the migration guidebut the biggest feature is probably that Akka 2.4 will be binary backwards compatible with Akka 2.3, see the detailed description below.

下载:https://github.com/akka/akka/archive/v2.4.0-RC1.zip