16 maj 2014 kl. 13:18 skrev PVillela <[email protected]>: > I am using this for a very specific end -- to write a little discrete time > simulation framework with actors. I need everything to execute in a single > thread so that the simulation agenda can control the dispatch of events.
CallingThreadDispatcher does not give you more control about the dispatch than any other—in fact there are cases (involving failure handling) where the message will not be processed on the calling thread. What you describe does not sound like a use-case for Actors (I mean in particular the “control the dispatch of events” part), unless you model the control part as actors and send the events as messages only once it is time for them to be processed. Regards, Roland > > > On Wednesday, May 14, 2014 3:19:44 AM UTC-4, rkuhn wrote: > > 14 maj 2014 kl. 08:32 skrev PVillela <[email protected]>: > >> I have been trying to set the dispatcher for an actor system to be used by >> default for actors created with the actor system but I can't get it to work. >> Specifically, I want to use the akka.testkit.CallingThreadDispatcher. > > This is a very bad idea, and it might well not work at all: > CallingThreadDispatcher is a very specific debug-only tool with limited > semantics, and using it as the default dispatcher will have adverse effects > on all the system actors that the ActorSystem implicitly creates under the > hood. Please configure a dedicated dispatcher of this type and use it > explicitly for those actors which you want to test. > > Regards, > > Roland > >> I have tried the following two configurations (at the classpath root) but >> they don't work (println(myActorSystem.dispatcher.getClass() still yields >> akka.dispatch.Dispatcher): >> >> akka { >> loglevel = DEBUG >> >> default-dispatcher { >> type="akka.testkit.CallingThreadDispatcherConfigurator" >> } >> } >> >> akka { >> loglevel = DEBUG >> >> default-dispatcher { >> type="akka.test.calling-thread-dispatcher" >> } >> } >> >> I'm using akka 2.10-2.2.3. >> >> Thanks for any assistance. >> >> -- >> >>>>>>>>>> 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 http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. > > > > Dr. Roland Kuhn > Akka Tech Lead > Typesafe – Reactive apps on the JVM. > twitter: @rolandkuhn > > > > -- > >>>>>>>>>> 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 http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. Dr. Roland Kuhn Akka Tech Lead Typesafe – Reactive apps on the JVM. twitter: @rolandkuhn -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
