Potentially a very silly question–
Is it possible to customize Akka/Scala actors such that you control the threads that are used by the actors? e.g. can you initialize your own set of threads to be used in the thread pool, or otherwise control/modify the threads?
In Akka, the thread pool is managed via a MessageDispatcher instance. You can set the dispatcher you want to actors easily:
To provide your own dispatcher, you can extend
akka.dispatch.MessageDispatcher(see existing dispatchers implementation for examples). Here you can play directly with the threads.Of course, it’s dangerous to put business logic inside a dispatcher because it may break the actor model and increase the number of concurrency bugs…