加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Akka和Scala一样有反应吗?还是由调度员处理?

发布时间:2020-12-16 19:15:19 所属栏目:安全 来源:网络整理
导读:根据我的理解,它没有,有两种方法来创建一个actor,它通过扩展Actor类和实现接收,或者使用一个actor方法创建一个匿名Actor.到现在为止还挺好. Akka有调度员的概念(http://akka.io/docs/akka/1.1.3/scala/dispatchers.html),所以这意味着一旦我创建了一个演员并
根据我的理解,它没有,有两种方法来创建一个actor,它通过扩展Actor类和实现接收,或者使用一个actor方法创建一个匿名Actor.到现在为止还挺好.

Akka有调度员的概念(http://akka.io/docs/akka/1.1.3/scala/dispatchers.html),所以这意味着一旦我创建了一个演员并实现了接收,默认情况下我得到了事件调度程序类似于Scala中的反应?当然,如果我需要将我的actor绑定到操作系统的线程,那么我将使用基于线程的调度程序,这类似于在Scala中接收吗?

解决方法

Akka has a concept of dispatchers (http://akka.io/docs/akka/1.1.3/scala/dispatchers.html),so does that mean that once I create an actor and implement the receive,by default I get the event dispatcher which is similar to the react in Scala?

是.

Of course,if i need to tie my actor to the thread of the OS then I would be using the thread based dispatcher,is this similar to receive in Scala?

是.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读