[akka-user] Re: http proxy support

2016-11-02 Thread André
Hi,

this config was supported in Spray but wasn't yet ported over to akka-http.

> Based on what I've read so far I need to enable the configuration and 
then it should work with Http().singleRequest
> however it's not connecting through the proxy.

May I ask where you got that info from?

Cheers
André

On Monday, October 31, 2016 at 11:26:44 PM UTC+1, sub...@gmail.com wrote:
>
> I'm interested in proxying http requests with akka-http. Based on what 
> I've read so far I need to enable the configuration and then it should work 
> with Http().singleRequest
> however it's not connecting through the proxy. I have the following config 
> in application.conf
>
> akka.http {
>
> host-connection-pool {
>
>   client {
>
> proxy {
>
>   http {
>
> host = 127.0.0.1
>
> post = 
>
>   }
>
> }
>
>   }
>
> }
> }
>
> and following code
>
> val responseFuture: Future[HttpResponse] =
>   Http().singleRequest(HttpRequest(uri = "http://akka.io";))
>
>
> val response: HttpResponse = Await.result(responseFuture, Duration.Inf)
>
> println(response.status.intValue())
>
>
> SBT has
>
>
> libraryDependencies += "com.typesafe.akka" %% "akka-http-core" % "2.4.11"
> libraryDependencies += "com.typesafe.akka" %% "akka-http-experimental" % 
> "2.4.11"
>
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Synchronization issue

2016-11-02 Thread Steve Winfield
Hey,

I got a question regarding a project I'm working on.

There are player actors that can be managed by a "player director" actor 
which belongs to a virtual room and supervises the players. A player 
maintains its current position and name as a mutable state.

The director looks like this:

class PlayerDirector extends Actor {
 
 private val players = mutable.Map[Int, ActorRef]() // Id, Player ref
 
 override def receive = {
  case SpawnPlayer(playerReference) => players += 
(incrementAndGetId() -> context.actorOf(Player.props(playerReference)))
  case RemovePlayer(id) => ...
 }
}


Now I'd like to execute some operations on all players which are positioned 
at x, y

My first attempt:

class PlayerDirector ...
   receive = {
  
  case ExecuteOnPlayersByPosition(position, callback) => {
for ((id, player) <- players) {
   player ! ExecuteIfPositionMatches(position, callback)
}
  }
  


Then, the player would check its position and execute the callback from its 
context. I don't like this implementation because it forces me to have the 
callback executed on the player's actor, but It's the only way to guarantee 
synchronization (I guess).

Do you have any advice for me?

Cheers!

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: http proxy support

2016-11-02 Thread subopt1
http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0/scala/http/configuration.html

also in the 2.4.11 docs but can't find that link at the moment

prior to the client section, under host-connection-pool it says


   1. # Please note that this section mirrors `akka.http.client` however is 
   used only for pool-based APIs,
   2. # such as `Http().superPool` or `Http().singleRequest`.

If that feature is not yet in Akka, is there any solution to get proxy 
support for use with Akka Streams? For example could I use a Netty or other 
http implementation and create a Source from that? Thanks!


On Wednesday, November 2, 2016 at 3:06:10 AM UTC-6, André wrote:
>
> Hi,
>
> this config was supported in Spray but wasn't yet ported over to akka-http.
>
> > Based on what I've read so far I need to enable the configuration and 
> then it should work with Http().singleRequest
> > however it's not connecting through the proxy.
>
> May I ask where you got that info from?
>
> Cheers
> André
>
> On Monday, October 31, 2016 at 11:26:44 PM UTC+1, sub...@gmail.com wrote:
>>
>> I'm interested in proxying http requests with akka-http. Based on what 
>> I've read so far I need to enable the configuration and then it should work 
>> with Http().singleRequest
>> however it's not connecting through the proxy. I have the following 
>> config in application.conf
>>
>> akka.http {
>>
>> host-connection-pool {
>>
>>   client {
>>
>> proxy {
>>
>>   http {
>>
>> host = 127.0.0.1
>>
>> post = 
>>
>>   }
>>
>> }
>>
>>   }
>>
>> }
>> }
>>
>> and following code
>>
>> val responseFuture: Future[HttpResponse] =
>>   Http().singleRequest(HttpRequest(uri = "http://akka.io";))
>>
>>
>> val response: HttpResponse = Await.result(responseFuture, Duration.Inf)
>>
>> println(response.status.intValue())
>>
>>
>> SBT has
>>
>>
>> libraryDependencies += "com.typesafe.akka" %% "akka-http-core" % "2.4.11"
>> libraryDependencies += "com.typesafe.akka" %% "akka-http-experimental" % 
>> "2.4.11"
>>
>>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Synchronization issue

2016-11-02 Thread Justin du coeur
Honestly, it's problematic -- passing callbacks around like this can easily
violate the invariants that make Actors work.  (In particular, if the
callback closes over any state in a different Actor, you're kind of begging
for trouble.)  By and large, any time you use the word "synchronization" in
the context of Actors it's a bit of a red flag.  This comes up a lot in the
context of gaming, and it's not easy to change one's thinking to not be
sync-oriented, but you'll get safer and more correct code if you can manage
it.

I recommend thinking about the problem, and whether there is a way to
restructure it in such a way that everything is based on requests,
responses, and fallbacks if something fails.  Every bit of state is
encapsulated and owned by exactly one Actor, and everybody else makes
requests on that.  (Note that this is pretty similar to how you usually
have to think anyway if you want to make a game scalable to multiple
servers.)

For example, have a single Actor who is the arbiter for a chunk of Space;
when players try to move into the Space, they *ask* that arbiter to let
them move in.  And if something happens to them at that point, the arbiter
sends them a message telling them what happens to them.

Etc.  I won't claim that it's easy, but you're likely to get more solid
code by thinking it through this way.

On Wed, Nov 2, 2016 at 9:18 AM, Steve Winfield  wrote:

> Hey,
>
> I got a question regarding a project I'm working on.
>
> There are player actors that can be managed by a "player director" actor
> which belongs to a virtual room and supervises the players. A player
> maintains its current position and name as a mutable state.
>
> The director looks like this:
>
> class PlayerDirector extends Actor {
>  
>  private val players = mutable.Map[Int, ActorRef]() // Id, Player ref
>  
>  override def receive = {
>   case SpawnPlayer(playerReference) => players +=
> (incrementAndGetId() -> context.actorOf(Player.props(playerReference)))
>   case RemovePlayer(id) => ...
>  }
> }
>
>
> Now I'd like to execute some operations on all players which are
> positioned at x, y
>
> My first attempt:
>
> class PlayerDirector ...
>receive = {
>   
>   case ExecuteOnPlayersByPosition(position, callback) => {
> for ((id, player) <- players) {
>player ! ExecuteIfPositionMatches(position, callback)
> }
>   }
>   
>
>
> Then, the player would check its position and execute the callback from
> its context. I don't like this implementation because it forces me to have
> the callback executed on the player's actor, but It's the only way to
> guarantee synchronization (I guess).
>
> Do you have any advice for me?
>
> Cheers!
>
> --
> >> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Synchronization issue

2016-11-02 Thread Rafał Krzewski
Hi,
the callbacks are definitely not a good idea. The idiomatic way is sending 
messages that are pure immutable data.
In your case, this means that the ExecuteOnPlayersByPosition message should 
act as an envelope for another message specifying the details of the 
operation.
It's not clear to me which actor tracks the positions of players. Supposing 
that it's the room supervisor actor: upon reception of 
ExecuteOnPlayersByPosition it filters the list of players by position and 
forwards the embedded message to their respective actors. Supposing that 
each player's actor tracks her own position, room supervisor forwards 
ExecuteOnPlayersByPosition verbatim to all players in the room, and 
player's actor checks the envelope and if position matches sends the 
extracted command to self, otherwise ignores the message.

Cheers,
Rafał


W dniu środa, 2 listopada 2016 14:18:43 UTC+1 użytkownik Steve Winfield 
napisał:
>
> Hey,
>
> I got a question regarding a project I'm working on.
>
> There are player actors that can be managed by a "player director" actor 
> which belongs to a virtual room and supervises the players. A player 
> maintains its current position and name as a mutable state.
>
> The director looks like this:
>
> class PlayerDirector extends Actor {
>  
>  private val players = mutable.Map[Int, ActorRef]() // Id, Player ref
>  
>  override def receive = {
>   case SpawnPlayer(playerReference) => players += 
> (incrementAndGetId() -> context.actorOf(Player.props(playerReference)))
>   case RemovePlayer(id) => ...
>  }
> }
>
>
> Now I'd like to execute some operations on all players which are 
> positioned at x, y
>
> My first attempt:
>
> class PlayerDirector ...
>receive = {
>   
>   case ExecuteOnPlayersByPosition(position, callback) => {
> for ((id, player) <- players) {
>player ! ExecuteIfPositionMatches(position, callback)
> }
>   }
>   
>
>
> Then, the player would check its position and execute the callback from 
> its context. I don't like this implementation because it forces me to have 
> the callback executed on the player's actor, but It's the only way to 
> guarantee synchronization (I guess).
>
> Do you have any advice for me?
>
> Cheers!
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Synchronization issue

2016-11-02 Thread Steve Winfield
All right, what if I'd use messages instead of a callback (The players 
handle their position by themselves)?

In this case I want the selected players to be kicked out of the room so I 
could send ExecuteOnPlayersByPosition(position, LeaveRoom) to every single 
player and they would handle it like this:

case ExecuteOnPlayersByPosition(pos, msg) if pos == this.position => {
  self ! msg
}
case LeaveRoom => ... // Leave room

What if I had more than one condition? What's the alternative to a 
 "ExecuteOnCoolPlayersByPositionAndName(...)" message?

Cheers!

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to reference an existing actor?

2016-11-02 Thread Harinath Mallepally
Hi Rafal,

How do I get to stop my actor, if i want to? looks like I don't see an
option. we have defined actors that do certain activities when ordered to
do so and have life cycle, so we create and then when we are done with it,
we are stopping too.  trying to avoid use deprecated methods now.

the ActorSystem.stop takes a ActorRef as input and not ActorSelection. Also
[1] says we preferable method to communicate with Actor is through ActorRef
and not through ActorSelection is this correct?

Thanks
Hari

1.
http://doc.akka.io/docs/akka/2.4/java/untyped-actors.html#Identifying_Actors_via_Actor_Selection



On Tue, Nov 1, 2016 at 4:00 PM, Harinath Mallepally 
wrote:

> Thanks, let me digest this. :-).
>
>
> On Tue, Nov 1, 2016 at 3:48 PM, Rafał Krzewski 
> wrote:
>
>> W dniu wtorek, 1 listopada 2016 23:38:22 UTC+1 użytkownik Harinath
>> Mallepally napisał:
>>>
>>> Thanks for the response,
>>>
>>> another question:
>>> How will I know that message is not delivered to the actor?
>>>
>>> You will not. You may know that the message WAS delivered if the
>> recipient sends back a reply. That's one of core principles of Akka:
>> http://doc.akka.io/docs/akka/2.4/general/message-delivery-re
>> liability.html
>> It may sound strange, but there's a deep meaning to it: it prevents you
>> from falling for https://en.wikipedia.org/wiki/Fallacies_of_distributed_c
>> omputing
>>
>> cheers,
>> Rafał
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Akka User List" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/akka-user/_nOT9QbkcbA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to reference an existing actor?

2016-11-02 Thread Justin du coeur
On Wed, Nov 2, 2016 at 1:28 PM, Harinath Mallepally 
wrote:

> the ActorSystem.stop takes a ActorRef as input and not ActorSelection.
> Also [1] says we preferable method to communicate with Actor is through
> ActorRef and not through ActorSelection is this correct?
>

That's correct.  The key here is the standard "Identify" message, which you
send to an ActorSelection, and which returns an ActorRef if it actually
exists.

(Alternatively, you could send your own homebrew message to the Actor,
using the ActorSelection, and let it stop itself.  Remember that every
Actor has a "self" member that is its own ActorRef.)

So in *general*, you use ActorSelection to fetch an ActorRef, and then
ActorRef to actually interact with the Actor.  That isn't required, but it
tends to be easiest...

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Synchronization issue

2016-11-02 Thread Justin du coeur
An additional parameter or two to the ExecuteOnPlayersByPosition message?

On Wed, Nov 2, 2016 at 1:21 PM, Steve Winfield  wrote:

> All right, what if I'd use messages instead of a callback (The players
> handle their position by themselves)?
>
> In this case I want the selected players to be kicked out of the room so I
> could send ExecuteOnPlayersByPosition(position, LeaveRoom) to every
> single player and they would handle it like this:
>
> case ExecuteOnPlayersByPosition(pos, msg) if pos == this.position => {
>   self ! msg
> }
> case LeaveRoom => ... // Leave room
>
> What if I had more than one condition? What's the alternative to a  "
> ExecuteOnCoolPlayersByPositionAndName(...)" message?
>
> Cheers!
>
> --
> >> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to reference an existing actor?

2016-11-02 Thread Harinath Mallepally
Thanks,

If I got it right, this works perfectly fine as long as the consumer is
also a actor, how about doing this from outside of akka? I mean the
invocation of actor.tell happens outside of the akka?

is it correct to say,If i am sure that my ActorSelection path is correct
(an actor is created with the given name/path) and then may be I just use
the ActorSelection itself.




On Wed, Nov 2, 2016 at 11:15 AM, Justin du coeur  wrote:

> On Wed, Nov 2, 2016 at 1:28 PM, Harinath Mallepally 
> wrote:
>
>> the ActorSystem.stop takes a ActorRef as input and not ActorSelection.
>> Also [1] says we preferable method to communicate with Actor is through
>> ActorRef and not through ActorSelection is this correct?
>>
>
> That's correct.  The key here is the standard "Identify" message, which
> you send to an ActorSelection, and which returns an ActorRef if it actually
> exists.
>
> (Alternatively, you could send your own homebrew message to the Actor,
> using the ActorSelection, and let it stop itself.  Remember that every
> Actor has a "self" member that is its own ActorRef.)
>
> So in *general*, you use ActorSelection to fetch an ActorRef, and then
> ActorRef to actually interact with the Actor.  That isn't required, but it
> tends to be easiest...
>
> --
> >> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/_nOT9QbkcbA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to reference an existing actor?

2016-11-02 Thread Justin du coeur
On Wed, Nov 2, 2016 at 3:15 PM, Harinath Mallepally 
wrote:

> If I got it right, this works perfectly fine as long as the consumer is
> also a actor, how about doing this from outside of akka? I mean the
> invocation of actor.tell happens outside of the akka?
>

That is exactly where "ask()" is helpful.  I generally discourage folks
from using ask directly from inside Actors, but it is critical for calling
them from the outside.


> is it correct to say,If i am sure that my ActorSelection path is correct
> (an actor is created with the given name/path) and then may be I just use
> the ActorSelection itself.
>

It's sometimes an appropriate choice, yes -- I do it in one or two places
myself.  But my understanding is that it's a bit less efficient, the
semantics are *slightly* different (relating to Actors getting restarted),
and as you said yourself, there are things you can do with ActorRef that
you can't do with ActorSelection...

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to reference an existing actor?

2016-11-02 Thread Rafał Krzewski
W dniu środa, 2 listopada 2016 18:28:22 UTC+1 użytkownik Harinath 
Mallepally napisał:
>
> Hi Rafal,
>
> How do I get to stop my actor, if i want to? looks like I don't see an 
> option. we have defined actors that do certain activities when ordered to 
> do so and have life cycle, so we create and then when we are done with it, 
> we are stopping too.  trying to avoid use deprecated methods now.
>

There are multiple ways:
- actor can stop itself by calling context.stop(self)
- actor can be stopped by it's parent - actor can access ActorRefs of all 
child actors it creates (context.childen, context.child(name: String))
- actor can be stopped automatically when it's parent is stopped
- you can send an akka.actor.PoisonPill message to an actor to stop it

Usually the first way is recommended: upon reaching a certain state (after 
receiving all pending confirmations, a timeout etc depending on use case) 
actor stops itself. 

cheers,
Rafał
 

>
> the ActorSystem.stop takes a ActorRef as input and not ActorSelection. 
> Also [1] says we preferable method to communicate with Actor is through 
> ActorRef and not through ActorSelection is this correct?
>
> Thanks
> Hari
>
> 1. 
> http://doc.akka.io/docs/akka/2.4/java/untyped-actors.html#Identifying_Actors_via_Actor_Selection
>
>
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.