I think the namespaces in your config are incorrect, deployment config for
an actor should
be under "akka.actor.deployment" (described in the docs here:
http://doc.akka.io/docs/akka/2.4.1/general/configuration.html#Actor_Deployment_Configuration)
and the dispatcher you refer to from your actor is actually under
akka.actor.function-scheduler-dispatcher
in your sample but you then refer to it only by the last name in the path
"function-scheduler-dispatcher".
I think what you intend would be:
akka.actor.deployment {
/function-scheduler {
dispatcher = function-scheduler-dispatcher
}
}
function-scheduler-dispatcher {
... dispatcher config ...
}
I hope this helps
--
Johan Andrén
Typesafe - Reactive apps on the JVM
Twitter: @apnylle
On Friday, January 29, 2016 at 1:42:33 AM UTC+1, Ian Nowland wrote:
>
> Hello,
>
> I'm trying to configure an ActorSystem, but no matter what I do, seem to
> be getting the default dispatcher. Here's what I've got going on:
>
> val customConf = ConfigFactory.parseString(
> """
> |akka {
> |
> | actor{
> |
> | /function-scheduler {
> | dispatcher = function-scheduler-dispatcher
> | }
> |
> | function-scheduler-dispatcher {
> | type = Dispatcher
> | executor = "fork-join-executor"
> | fork-join-executor {
> | # Min number of threads
> | parallelism-min = 2
> | # available processors * factor
> | parallelism-factor = 4.0
> | # Max number of threads
> | parallelism-max = 32
> | }
> | }
> | }
> |
> |}
> """.stripMargin)
>
> val system:ActorSystem =
> ActorSystem("function-scheduler",ConfigFactory.load(customConf))
> import system.dispatcher
>
> def scheduleOnce(delayTime: Long)(f:() => Unit):Unit = {
> import scala.language.postfixOps
> system.scheduler.scheduleOnce(delayTime milliseconds) {
> f()
> }
> }
>
> As you can see, what I'm trying to do is use a scheduler to be able to
> schedule arbitrary tasks. The problem is that everything I've tried in that
> customConf still results in system using the akka.actor.default-dispatcher.
> I definitely don't understand how the configuration stuff works, but my
> theory is that I'm configuring the dispatcher that would be used for
> created ActorRefs if I was to call something like:
>
> val myActor =
> system.actorOf(Props[MyActor].withDispatcher("function-scheduler-dispatcher"),
>
> "myactor1")
>
> rather than configuring the system itself.
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.