Akka的Actor与Scala的Actor模型有什么区别 [英] What's the difference of the Akka's Actor with Scala's Actor model

查看:75
本文介绍了Akka的Actor与Scala的Actor模型有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现还有Akka演员模型,所以我想知道Akka的演员模型和Scala的演员模型之间有什么区别?

I found there is also an Akka actor model, so I am wondering what's the difference between the Akka's Actor and Scala's Actor model?

推荐答案

嗯,没有。只有Actor模型,而Akka actor和Scala actor是该模型的两个实现

Well, there isn't. There is just Actor model, and Akka actors and Scala actors are two implementations of that model.

所有Actor模型都说您的并发原语是演员,可以:

All Actor model says that your concurrency primitives are actors, which can:


  • 接收一条消息并根据消息的内容决定下一步该做什么,包括:

  • receive a message and decide what to do next depending on the content of the message, including:

将消息发送给他们认识的任何演员

send messages to any actors they know about

创建新演员

并提供某些担保,例如:

and provides certain guarantees, e.g.:


  • 任何演员一次只能处理一条消息

  • any actor will only handle a single message at a time

演员X发送给演员Y的消息将按照发送的顺序到达

messages sent by actor X to actor Y will arrive in the order thay were sent

在此级别上,Scala和Akka演员之间没有区别。

There is no difference between Scala and Akka actors on this level.

有关其功能的差异,请参见不同的Scala Actor实施概述。对我来说,最大的好处是Akka支持主管和ActorRegistry。

For differences in what they can do, see Different Scala Actor Implementations Overview. The biggest one, for me, is that Akka supports supervisors and ActorRegistry.

这篇关于Akka的Actor与Scala的Actor模型有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆