gpt4 book ai didi

scala - Akka 有像 Scala 一样的 react 吗?还是由调度员处理?

转载 作者:行者123 更新时间:2023-12-04 11:59:02 25 4
gpt4 key购买 nike

根据我的理解,它没有,有两种方法可以创建一个 Actor,即扩展 Actor 类并实现接收,或者使用其中一种 Actor 方法创建一个匿名 Actor。到现在为止还挺好。

Akka 有一个调度程序的概念(http://akka.io/docs/akka/1.1.3/scala/dispatchers.html),这是否意味着一旦我创建了一个actor并实现了接收,默认情况下我会得到类似于 Scala 中的 react 的事件调度程序?当然,如果我需要将我的 Actor 绑定(bind)到操作系统的线程,那么我将使用基于线程的调度程序,这类似于在 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?



是的。

关于scala - Akka 有像 Scala 一样的 react 吗?还是由调度员处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7074446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com