Hi Prakash,
you will have to share (as in "pass around") the ActorSystem in one way or
another.
While a global variable with it is not the best idea for testing, it does
solve the problem, agreed.

Instead though (which does not break testing as much, and allows parallel
tests), simply pass around the ActorSystem via constructors of your classes.
If someone needs to create top-level actors, he should get the ActorSystem
passed in as an constructor argument.
Please remember that an Actor can also start child-Actors (context.actorOf)
which is the recommended way of starting more actors (build hierarhies).

-- Konrad

On Sat, Sep 13, 2014 at 9:42 AM, <[email protected]> wrote:

> Hello All,
>
> It's Done.
>
> Thank you so much for your support & to understand my problem very easily
> with prompt solution.
>
> On Monday, June 11, 2012 5:58:27 AM UTC+5:30, dimgel wrote:
>>
>> Hi all,
>>
>> Since actors are stateful, I have to create an actor tree for each HTTP
>> request I handle, right?
>>
>> Have I to create ActorSystem for each request too, or I can create the
>> only one in Servlet.init(), reuse it for all (possibly concurrent)
>> requests, and shut it down in Servlet.destroy()?
>>
>> Is there any recommended way of generating unique ActorSystem names if
>> each request needs its own ActorSystem, or unique Actor names otherwise?
>> (AFAIK names are optional and that's OK for standalone server, but anyway
>> maybe someone came upon some guidelines about naming in distributed
>> environment.)
>>
>> Thanks. =)
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      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