Re: [akka-user] How to group a list of actors in Akka?

2017-03-22 Thread Konrad Malawski
On 22 March 2017 at 03:06:34, kant kodali (kanth...@gmail.com) wrote:

I think I understand it better from what you said. I guess I don't have
separate parent for each group therefore I was looking to see how to group
the child actors but anyways since it is not the standard approach from
what you are saying I would not go that way. I believe I can leverage event
bus  for this
since all I want to do is broadcast different messages to different groups
of actors within a single JVM.

Maybe, not sure what your exact use case is. Picking the simplest thing to
solve your problem is usually a good rule of thumb



Is it recommended to have multiple actors systems within the same JVM? I am
using the Play framework and it has a default Actor system but I wondering
if I should use Actor system provided by the Play framework or create my
own to leverage event bus?

One system is fine, do however read about blocking (google "akka blocking")
to learn how to configure dispatchers to avoid blocking the main dispatcher.



I am assuming the different between pub-sub and event bus is one is
distributed and other is not respectively. isn't it?

Yeah, event-bus is just a quick local thing. Distributed Pub Sub is
distributed pub-sub :)


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

-- 
>>  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 group a list of actors in Akka?

2017-03-21 Thread kant kodali
I think I understand it better from what you said. I guess I don't have
separate parent for each group therefore I was looking to see how to group
the child actors but anyways since it is not the standard approach from
what you are saying I would not go that way. I believe I can leverage event
bus  for this
since all I want to do is broadcast different messages to different groups
of actors within a single JVM.

Is it recommended to have multiple actors systems within the same JVM? I am
using the Play framework and it has a default Actor system but I wondering
if I should use Actor system provided by the Play framework or create my
own to leverage event bus?

I am assuming the different between pub-sub and event bus is one is
distributed and other is not respectively. isn't it?

Thanks for your time
kant





On Tue, Mar 21, 2017 at 2:39 PM, Justin du coeur  wrote:

> Not sure I understand the desired use case, but I believe the answer is no
> -- the *path* of an Actor has to be unique.  That is, for a given parent,
> only one child may have a given name.
>
> Is there a reason not to just have the parent maintain separate lists of
> the different groups?  You seem to be trying to find a built-in solution to
> a problem that folks usually just solve manually (because it is usually
> extremely easy to do so).
>
> On Tue, Mar 21, 2017 at 4:18 PM, kant kodali  wrote:
>
>> Can two actors have the  same name? For Example, Can I create same
>> instance of Actor class in a For loop so I can access all the actors by
>> that name?
>>
>> On Tue, Mar 21, 2017 at 6:12 AM, Justin du coeur 
>> wrote:
>>
>>> Right -- that's probably the way I would tend to construct something
>>> like this, but it would depend on the use case, as well as whether the
>>> "groups" in question were mutually exclusive...
>>>
>>> On Tue, Mar 21, 2017 at 9:05 AM, Konrad Malawski <
>>> konrad.malaw...@lightbend.com> wrote:
>>>

 As such, no -- there's no formal "group" concept like this, although
 you could construct it manually yourself.

 There is "all children of given actor" which is accessible by
 context.children() inside an Actor.




 --
 Konrad `ktoso` Malawski
 Akka  @ Lightbend 


 On 21 March 2017 at 15:02:26, Justin du coeur (jduco...@gmail.com)
 wrote:

>>>
>>> --
>>> >> 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/grou
>>> p/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/UAFqhZYk8uc/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/c
>> urrent/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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/UAFqhZYk8uc/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 

Re: [akka-user] How to group a list of actors in Akka?

2017-03-21 Thread Justin du coeur
Not sure I understand the desired use case, but I believe the answer is no
-- the *path* of an Actor has to be unique.  That is, for a given parent,
only one child may have a given name.

Is there a reason not to just have the parent maintain separate lists of
the different groups?  You seem to be trying to find a built-in solution to
a problem that folks usually just solve manually (because it is usually
extremely easy to do so).

On Tue, Mar 21, 2017 at 4:18 PM, kant kodali  wrote:

> Can two actors have the  same name? For Example, Can I create same
> instance of Actor class in a For loop so I can access all the actors by
> that name?
>
> On Tue, Mar 21, 2017 at 6:12 AM, Justin du coeur 
> wrote:
>
>> Right -- that's probably the way I would tend to construct something like
>> this, but it would depend on the use case, as well as whether the "groups"
>> in question were mutually exclusive...
>>
>> On Tue, Mar 21, 2017 at 9:05 AM, Konrad Malawski <
>> konrad.malaw...@lightbend.com> wrote:
>>
>>>
>>> As such, no -- there's no formal "group" concept like this, although you
>>> could construct it manually yourself.
>>>
>>> There is "all children of given actor" which is accessible by
>>> context.children() inside an Actor.
>>>
>>>
>>>
>>>
>>> --
>>> Konrad `ktoso` Malawski
>>> Akka  @ Lightbend 
>>>
>>>
>>> On 21 March 2017 at 15:02:26, Justin du coeur (jduco...@gmail.com)
>>> wrote:
>>>
>>
>> --
>> >> 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/UAFqhZYk8uc/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.
>

-- 
>>  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 group a list of actors in Akka?

2017-03-21 Thread kant kodali
Can two actors have the  same name? For Example, Can I create same instance
of Actor class in a For loop so I can access all the actors by that name?

On Tue, Mar 21, 2017 at 6:12 AM, Justin du coeur  wrote:

> Right -- that's probably the way I would tend to construct something like
> this, but it would depend on the use case, as well as whether the "groups"
> in question were mutually exclusive...
>
> On Tue, Mar 21, 2017 at 9:05 AM, Konrad Malawski <
> konrad.malaw...@lightbend.com> wrote:
>
>>
>> As such, no -- there's no formal "group" concept like this, although you
>> could construct it manually yourself.
>>
>> There is "all children of given actor" which is accessible by
>> context.children() inside an Actor.
>>
>>
>>
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka  @ Lightbend 
>>
>>
>> On 21 March 2017 at 15:02:26, Justin du coeur (jduco...@gmail.com) wrote:
>>
>
> --
> >> 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/UAFqhZYk8uc/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 group a list of actors in Akka?

2017-03-21 Thread Justin du coeur
Right -- that's probably the way I would tend to construct something like
this, but it would depend on the use case, as well as whether the "groups"
in question were mutually exclusive...

On Tue, Mar 21, 2017 at 9:05 AM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

>
> As such, no -- there's no formal "group" concept like this, although you
> could construct it manually yourself.
>
> There is "all children of given actor" which is accessible by
> context.children() inside an Actor.
>
>
>
>
> --
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
>
> On 21 March 2017 at 15:02:26, Justin du coeur (jduco...@gmail.com) wrote:
>

-- 
>>  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 group a list of actors in Akka?

2017-03-21 Thread Konrad Malawski
As such, no -- there's no formal "group" concept like this, although you
could construct it manually yourself.

There is "all children of given actor" which is accessible by
context.children() inside an Actor.




-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 


On 21 March 2017 at 15:02:26, Justin du coeur (jduco...@gmail.com) wrote:

-- 
>>  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 group a list of actors in Akka?

2017-03-21 Thread Justin du coeur
As such, no -- there's no formal "group" concept like this, although you
could construct it manually yourself.

I suspect this use case is usually handled with PubSub -- each group
subscribes to an appropriate channel.  (But I don't use this myself, so
can't say for sure.)

On Tue, Mar 21, 2017 at 6:16 AM, kant kodali  wrote:

> Hi All,
>
> How to group a list of actors? I want to send message A to group of Actors
> M and message B to group of Actors N. Is there a way to give them a common
> name and access them through that name so I can send my messages? or Is
> there any better way?
>
> 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 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] How to group a list of actors in Akka?

2017-03-21 Thread kant kodali
Hi All,

How to group a list of actors? I want to send message A to group of Actors 
M and message B to group of Actors N. Is there a way to give them a common 
name and access them through that name so I can send my messages? or Is 
there any better way?

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