An Actor can only have one Receive method active at any given time; by
default, it's the value of receive.  You can't just add another method and
have it work -- it'll never be used unless you become(handler).  (Or
compose the two PartialFunctions together and set receive to that.)

Is there a reason for wanting two separate Receive functions?

On Mon, Jul 11, 2016 at 4:24 PM, <anik...@egnaroinc.com> wrote:

> Hi
>
> I have a class
>  MyActorClass(out,post)
>
> where out and post are 2 actors passed as an argument to it. It has a
> receive function like this:
> def receive = {
>
> case msg:String =>  myfunction
>
> }
>
>
>
> and another receive function as:
>
> def handler:Receive = {
>
> case handlingMsg =>  //some logic
>
> case handlingMsgAgain => //some logic
>
> }
>
>
>
> Now in
> myfunction
>
> body , am calling the
> post ! handlingMsg
>
> . But somehow it is not working and also not showing any error. It works
> if i shift my
> handlingMsg
>
> case in receive method.What am i doing wrong here?
>
> --
> >>>>>>>>>> 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.

Reply via email to