Checking if Actor is working

35 views
Skip to first unread message

Mauri

unread,
Jul 26, 2012, 11:24:04 AM7/26/12
to play-fr...@googlegroups.com
Hi,

I'm creating an actor like this, in order to call it every 15 minutes.

myActorCancellable =  actorSystem.scheduler().schedule(Duration.Zero(),
                Duration.create(15, TimeUnit.MINUTES),
                myActor,
                "START"
                );

But as the run of this actor can last longer than 15 Minutes, I want to check, if it is running, before sending a Start-Signal. Does anyone how to achieve that?

Thank you very much.

Mauri

johanandren

unread,
Jul 26, 2012, 12:55:45 PM7/26/12
to play-fr...@googlegroups.com
Not entirely sure I understand what you want to achieve but one possible solutions could be:

Let the work actor do the actual work in a future and ignore new "START" messages if there is a future that is not complete.

Paulo "JCranky" Siqueira

unread,
Jul 28, 2012, 8:03:29 AM7/28/12
to play-fr...@googlegroups.com

This 15 minutes run, which can be more, is it blocking?

[]s,

Paulo "JCranky" Siqueira
http://jcranky.com

Em 26/07/2012 13:55, "johanandren" <johan....@mejsla.se> escreveu:
Not entirely sure I understand what you want to achieve but one possible solutions could be:

Let the work actor do the actual work in a future and ignore new "START" messages if there is a future that is not complete.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/TTuKFGYQSHMJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Reply all
Reply to author
Forward
0 new messages