I have defined a custom dispatcher in application.conf like this:
my-special-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 1
}
throughput = 1
}
The documentation says to create an actor using a custom dispatcher like this:
context
.spawn(
yourBehavior,
"DispatcherFromConfig",
DispatcherSelector.fromConfig("your-dispatcher")
)
However, I want to use this custom dispatcher for the guardian actor, which is not created via context.spawn
.
I currently create my actor system and guardian actor like this:
implicit val myActorSystem: ActorSystem[MyGuardianActor.Request] = {
ActorSystem[MyGuardianActor.Request](
MyGuardianActor(),
name = "MyGuardianActorSingleton"
)
How would I modify this to use my custom dispatcher called "my-special-dispatcher"?
Note: I only want to use the custom dispatcher for the guardian actor. All other actors in the system should use the default dispatcher.