It's unclear to me what you are describing/asking here, could you elaborate?

If you send a message from a non actor the sender will be dead letter as
there is no actual actor to reply to.

Calling a function from the receive block doesn't require that function to
be in the same class (or file), just that it is available in the scope.
Note however that if it touches the internal state of the actor it is best
located inside the actor.

-- 
Johan

On Tue, Jul 12, 2016 at 6:28 PM, <anik...@egnaroinc.com> wrote:

> If am defining the
> myfunction
>
> in separate file, its not calling the
> post ! handlingMsg
>
> . It works if it is defined in the same Class. Actually, in handlingMsg
> case, sender becomes DeadLetter. How to achieve that from separate file?
>
>
> On Tuesday, July 12, 2016 at 1:54:59 AM UTC+5:30, ani...@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