Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Actor pool in 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!

like image 244
ghedas Avatar asked Dec 28 '22 16:12

ghedas


1 Answers

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

like image 54
Robert Harvey Avatar answered Jan 11 '23 11:01

Robert Harvey