Hi Victor,

Thanks for your reply. While I was trying to create the sample, I realized 
the problem was that I was using TestActorRef and that was probably the 
reason. When I moved my test to using JavaTestKit, it worked fine. Your 
reply helped me to get to the problem and thanks for that.

Regards,
Boney

On Wednesday, April 16, 2014 5:24:52 PM UTC+8, √ wrote:
>
> Hi Boney,
>
> can you create a _minimized_ code sample that is self contained and shows 
> the perceived bug?
>
>
> On Wed, Apr 16, 2014 at 10:59 AM, Boney Sekh <bone...@gmail.com<javascript:>
> > wrote:
>
>> Hi,
>>
>> I thought I should add this. Basically this works when my TestActor is at 
>> the system level, i.e. system.actorOf. However what I am trying to do is to 
>> stop an actor *which is a child of another*. 
>>
>> Thanks,
>> B
>>
>>
>> On Wednesday, April 16, 2014 1:55:59 PM UTC+8, Boney Sekh wrote:
>>>
>>> Hi,
>>>
>>> I have been trying to use the Patterns.gracefulStop to stop an actor 
>>> gracefully. I know my internal actor is stopped by verifying the postStop 
>>> method is invoked.
>>> However, the future is not returning true and is held until timeout.
>>>
>>> Is there a bug?
>>>
>>> Here is my code:
>>>
>>> public class TestActor extends UntypedActor {
>>>
>>>     private final Logger log = LoggerFactory.getLogger(TestActor.class);
>>>
>>>     final ActorRef target;
>>>
>>>     public TestActor( ActorRef target ) {
>>>         this.target = target;
>>>     }
>>>
>>>     @Override
>>>     public void postStop() throws Exception {
>>>         super.postStop();
>>>         log.info("Actor stopped...");
>>>     }
>>>
>>>     @Override
>>>     public void onReceive( Object msg ) {
>>>         if ( msg == Command.STOP_PROCESSING ) {
>>>             log.info("Stopping actor...");
>>>             getContext().stop( getSelf() );
>>>         } else {
>>>             unhandled(msg);
>>>         }
>>>     }
>>>
>>> }
>>>
>>> Code to stop:
>>>
>>> Future< Boolean > stopped = Patterns.gracefulStop( actorRef, 
>>> Duration.create( 5, TimeUnit.SECONDS ), Command.STOP_PROCESSING );
>>> Await.result( stopped, Duration.Inf() );
>>>
>>  -- 
>> >>>>>>>>>> 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+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to