scala 中的演员池

发布于 2024-09-02 03:55:15 字数 233 浏览 6 评论 0原文

我有一个基于参与者的项目,对于其中的一部分,我必须使用一些接收消息的参与者,然后一个参与者单独分配给每个请求,每个参与者负责执行其消息请求,所以我需要像线程这样的东西我的项目的参与者池,Scala 中是否有任何功能对我的需要有用?

我还有一个问题:我的项目有大量请求,而且这些请求必须尽快完成,所以我认为需要一个 actor-pool 来处理它们,Scala 中是否有与我的需求相关的功能?


非常需要您的关注!

I have a project that is actor-based and for one part of it I must use some actors that receive message after that one actor assigns to each request separately and each actor is responsible for doing its message request, so I need something like a thread pool for actors of my project, are there any features in Scala that is useful for my necessity?

I have another question: My project has a great amount of requests and also these requests must be done as soon as possible so I thought that an actor-pool is necessary for handling them, is there any feature in Scala that is related to my demand?

tanks a lot for your attention!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

还在原地等你 2024-09-09 03:55:15

Actor [已经] 在线程池上执行。最初有 4 个工作线程。如果所有工作线程都被阻塞但仍有剩余任务需要处理,则线程池会增长。理想情况下,线程池的大小与机器的处理器核心的数量相对应。

http://www.scala-lang.org/node/242

Actors are [already] executed on a thread pool. Initially, there are 4 worker threads. The thread pool grows if all worker threads are blocked but there are still remaining tasks to be processed. Ideally, the size of the thread pool corresponds to the number of processor cores of the machine.

http://www.scala-lang.org/node/242

情话已封尘 2024-09-09 03:55:15

本演讲对此进行了详细描述。从末尾算起的第七张幻灯片描述了在线程池上运行的事件驱动的参与者。我相信这没有任何第三方库。全部内置。

This is described in detail in this talk. Seventh slide counting from the end describes event driven actors running on a thread pool. This is without any third party library i believe. All built in.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文