Schedule a Job in Play with Akka

Greetings to all ,

In this blog we will see how we can schedule a job after some time period in play using Scala .

I assume that reader of this blog have little knowledge about :

  • Akka
  • Play and
  • Scala

So here we start with an actor where we will write our job to be scheduled as follow :

Now we will define scheduler for the above job to execute at certain duration as follow :

Now we need to bind the above actor and scheduler as :

Now tell the play to start the actor after schedule time. We only need to write following configuration inside application.conf :

And now cheers 🙂 your scheduler will start scheduling your job after specified duration once your server is up .

Thanks

KNOLDUS-advt-sticker

Written by 

Software Consultant At Knoldus

Leave a Reply

%d bloggers like this: