actor

_
timcharper
1月 20 02:18

@timcharper , so what app the actor model can help, and what app the thread modle can help, could you please give me some advice? say, a heavy traffic app, for example a instant message server is ok using actor model, bussy logic is not very complicated. :point_up: January 18, 2016 10:39 PM

@bonafideyan depends on the properties of your system. If you have high concurrency, using the actor model can allow you to manage mutable state without needing to use mutexes, and also can run more efficiently since it can allow a single core to be devoted to a single task (reducing expensive context switches). It does this with relatively low overhead. Avoiding locks is almost always a win nowadays because it allows you to horizontally scale your processes better.

Also, the actor model is more elastic than, say, what Kafka provides. In Kafka, you can‘t modify partitions on the fly, and partitions are effectively round-robin. (if you have a consumer group processing a partition quickly, then they can‘t just use their spare resources to help out with the other partition). etc. So, Kafka has lower overhead because it has a simpler model for distributing messages, but with that simpler model comes constraints that may not work for your well for your needs.
In general, I would probably pick Kafka something that did high data throughput (log processing), was processed asynchronously, and has with more lenient SLAs (in terms of data freshness). If you require something more real-time, I‘d go with the Actor model.

时间: 2024-10-23 23:13:01

actor的相关文章

actor运行报错:java.lang.ClassNotFoundException

object SimpleAkkaTest { def main(args: Array[String]) { val system = ActorSystem.create("system") val work =system.actorOf(Props[Worker],"worker-1") work ! 1 } } class Worker extends Actor { override def receive = { case 1=> println

初解,Scala语言中基于Actor的并发编程的机制,并展示了在Spark中基于Scala语言的Actor而产生的消息驱动框架Akka的使用,

Scala深入浅出实战中级--进阶经典(第66讲:Scala并发编程实战初体验及其在Spark源码中应用解析)内容介绍和视频链接 2015-07-24 DT大数据梦工厂 从明天起,做一个勤奋的人 看视频.下视频,分享视频 DT大数据梦工厂-Scala深入浅出实战中级--进阶经典:第66讲:Scala并发编程实战初体验及其在Spark源码中的应用解析 本期视频通过代码实战详解了Java语言基于加锁的并发编程模型的弊端以及Scala语言中基于Actor的并发编程的机制,并展示了在Spark中基于Sc

.NET的Actor模型:Orleans

Orleans是微软推出的类似Scala Akka的Actor模型,Orleans是一个建立在.NET之上的,设计的目标是为了方便程序员开发需要大规模扩展的云服务, 可用于实现DDD+EventSourcing/CQRS系统. 传统的三层体系结构包括无状态的前端,无状态的中间层和存储层在可伸缩性方面是有限制的,由于存储层在延迟和吞吐量方面的限制,这对于每个用户请求都有影响.通常办法是在中间层和存储层之间添加缓存层来提高性能.然而,缓存会失去了大部分的并发性和底层存储层的语义保证.为了防止缓存和存

Libgdx window add alpha action change the background actor alpha

现象: Stage中包括一个Window,一个Actor,Window中加入alpha action后,Actor也随之消失:Actor加入alpha action后,不起作用. 解决: 重写draw方法,加入batch.setColor(getColor().r, getColor().g, getColor().b, getColor().a); import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.scene

scala中的Actor

1.介绍 2.简单示例 3.第二个程序 4.通信程序 1 package day01 2 import scala.actors.Actor 3 case class Message(content: String, sender: Actor) 4 class LeoActor extends Actor{ 5 def act(){ 6 while (true){ 7 receive{ 8 case Message(content,sender)=>{ 9 println("leo: &

Actor模型[转]

原文链接:http://blog.jeoygin.org/archives/477 Actor这个模型由Carl Hewitt在1973年提出,Gul Agha在1986年发表技术报告“Actors: A Model of Concurrent Computation in Distributed Systems”,至今已有不少年头了.在计算机科学中,它是一个并行计算的数学模型,最初为由大量独立的微处理器组成的高并行计算机所开发,Actor模型的理念非常简单:天下万物皆为Actor. Actor

UE4常见的Actor类型

UE4引擎里常见的Actor类型: 类型 图标 描述 网格物体 & 几何体Actor类型 StaticMeshActor 静态网格物体Actor 是一种简单的Actor类型,用于在场景中显示一个网格物体.尽管其名称暗示该Actor是静态的或者是不能移动的,但是此名称中的 静态 是指这种网格物体类型使用的是StaticMesh(静态网格物体).由于这些网格物体的几何体不能改变,所以这些网格物体是静态的.但是,实际上在游戏运行过程中可以通过其他方式来移动及修改Actor.这些Actor一般用作为 世

UE4 Actor生命周期

Actor生命周期 创建过程 SpawnActor called PostSpawnInitialize PostActorCreated ExecuteConstruction: OnConstruction PostActorConstruction: PreInitializeComponents InitializeComponent PostInitializeComponents OnActorSpawned broadcast on UWorld BeginPlay

Scala 深入浅出实战经典 第67讲:Scala并发编程匿名Actor、消息传递、偏函数解析

王家林亲授<DT大数据梦工厂>大数据实战视频 Scala 深入浅出实战经典(1-87讲)完整视频.PPT.代码下载:百度云盘:http://pan.baidu.com/s/1c0noOt6 腾讯微云:http://url.cn/TnGbdC 360云盘:http://yunpan.cn/cQ4c2UALDjSKy 访问密码 45e2土豆:http://www.tudou.com/programs/view/LwsfuGIsWEk/优酷:http://v.youku.com/v_show/id_

actor binary tree lab4

forward 与 ! (tell) 的差异,举个例子: Main(当前actor): topNode ! Insert(requester, id=1, ele = 2) topNode: root ! Insert(requester, id=1, ele = 2) 对于root而言,Insert消息的来源是topNode 假如第二行替换为 topNode: root forward Insert(requester, id=1, ele = 2) 此时,对于root而言,Insert消息的