As I explained on the ticket using CallingThreadDispatcher for the 
default-dispatcher is not supported and is not going to be successful in 
general, CallingThreadDispatcher is not a general purpose dispatcher (and this 
is a fundamental restriction that cannot be lifted—believe me, I tried ;-) ). 
If you want to run with just one thread then you’ll have to configure a thread 
pool of size one instead, but if you do that then any use of Await.result() or 
other blocking APIs can easily deadlock your whole system.

Regards,

Roland

> 14 jul 2015 kl. 17:49 skrev Hosam Aly <[email protected]>:
> 
> Hi Konrad,
> 
> Thanks for the quick reply!
> 
> I actually wish I could run it with just 1 thread. I wish my tests could 
> become totally synchronous. I am trying to find out how to do that.
> 
> I am currently configuring it in application.conf.
> 
> Any suggestions would be appreciated!
> 
> 
> Thank you,
> 
> Hosam Aly
> 
> On Tuesday, July 14, 2015 at 4:20:40 PM UTC+1, Konrad Malawski wrote:
> Hi Hosam,
> why do you want to run Akka using 2 threads?
> Where do you configure the calling thread dispatcher?
> 
> -- 
> Cheers,
> Konrad 'ktoso’ Malawski
> Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>
> 
> On 14 July 2015 at 17:02:16, Hosam Aly ([email protected] <javascript:>) 
> wrote:
> 
>> Hi,
>> 
>> I am trying to use the `CallingThreadDispatcherConfigurator`, but 
>> unfortunately the test blocks as soon as I try to instantiate an actor, with 
>> a deadlock that looks similar to an akka issue 
>> <https://github.com/akka/akka/issues/17253>. Have you faced a similar 
>> situation before? Do you have any idea how to get it working?
>> 
>> 
>> On Thursday, January 19, 2012 at 4:00:04 PM UTC, D Pars wrote:
>> Patrik,
>> This works like a charm!  (...he says as he deletes dozens and dozens
>> of Thread.sleeps from his tests).
>> 
>> Thank you!
>> 
>> On Jan 19, 4:31 am, Patrik Nordwall <[email protected] <>> wrote:
>> > You should define the class name of the MessageDispatcherConfigurator, not
>> > the actual dispatcher.
>> > Try type = "akka.testkit.CallingThreadDispatcherConfigurator"
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Wed, Jan 18, 2012 at 10:50 PM, D Pars <[email protected] <>> wrote:
>> > > On my TEST classpath, I'm trying to use a .conf file with a
>> > > CallingThreadDispatcher to mimic the behavior of a TestActorRef.
>> >
>> > > Is there a way to do this globally?
>> >
>> > > The following:
>> >
>> > > default-dispatcher {
>> > >        type="akka.testkit.CallingThreadDispatcher"
>> > > }
>> >
>> > > Is resulting in:
>> >
>> > > java.lang.IllegalArgumentException: Cannot instantiate
>> > > MessageDispatcherConfigurator type
>> > > [akka.testkit.CallingThreadDispatcher], defined in [akka.actor.default-
>> > > dispatcher], make sure it has constructor with
>> > > [com.typesafe.config.Config] and
>> > > [akka.dispatch.DispatcherPrerequisites] parameters
>> > >        at 
>> > > akka.dispatch.Dispatchers.configuratorFrom(Dispatchers.scala:149)
>> > >        at
>> > > akka.dispatch.Dispatchers.lookupConfigurator(Dispatchers.scala:78)
>> > >        at akka.dispatch.Dispatchers.lookup(Dispatchers.scala:68)
>> > >        at
>> > > akka.dispatch.Dispatchers.defaultGlobalDispatcher(Dispatchers.scala:
>> > > 58)
>> > >        at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:368)
>> > >        at akka.actor.ActorSystem$.apply(ActorSystem.scala:46)
>> > >        at akka.actor.ActorSystem$.create(ActorSystem.scala:45)
>> > >        at akka.actor.ActorSystem.create(ActorSystem.scala)
>> > >        ...
>> > > Caused by: java.lang.NoSuchMethodException:
>> > > akka.testkit.CallingThreadDispatcher.<init>(com.typesafe.config.Config,
>> > > akka.dispatch.DispatcherPrerequisites)
>> > >        at java.lang.Class.getConstructor0(Class.java:2706)
>> > >        at java.lang.Class.getDeclaredConstructor(Class.java:1985)
>> > >        at akka.util.ReflectiveAccess$$anonfun$createInstance
>> > > $2.apply(ReflectiveAccess.scala:35)
>> > >        at akka.util.ReflectiveAccess$$anonfun$createInstance
>> > > $2.apply(ReflectiveAccess.scala:30)
>> > >        at akka.util.ReflectiveAccess
>> > > $.withErrorHandling(ReflectiveAccess.scala:106)
>> > >        at
>> > > akka.util.ReflectiveAccess$.createInstance(ReflectiveAccess.scala:
>> > > 30)
>> > >        at 
>> > > akka.dispatch.Dispatchers.configuratorFrom(Dispatchers.scala:146)
>> > >        ... 38 more
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google Groups
>> > > "Akka User List" group.
>> > > To post to this group, send email to [email protected] <>.
>> > > To unsubscribe from this group, send email to
>> > > [email protected] <>.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/akka-user?hl=en 
>> > ><http://groups.google.com/group/akka-user?hl=en>.
>> >
>> > --
>> >
>> > Patrik Nordwall
>> > Typesafe <http://typesafe.com/ <http://typesafe.com/>> -  The software 
>> > stack for applications that
>> > scale
>> > Twitter: @patriknw
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
>> >>>>>>>>>> Check the FAQ: 
>> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
>> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
>> >>>>>>>>>> <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] <javascript:>.
>> To post to this group, send email to [email protected] <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user 
>> <http://groups.google.com/group/akka-user>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe <http://typesafe.com/> – Reactive apps on the JVM.
twitter: @rolandkuhn
 <http://twitter.com/#!/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.

Reply via email to