Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka Stream - Timer or Scheduler like CRON

I use Akka Stream on Scala. I'd like to set a scheduler which runs on every 24:00. I tried to search for it. But I could't find what I want to do. Could you tell me how to write code?

like image 444
ryo Avatar asked Jul 20 '16 08:07

ryo


People also ask

What is Akka scheduler?

The scheduler in Akka is designed for high-throughput of thousands up to millions of triggers. The prime use-case being triggering Actor receive timeouts, Future timeouts, circuit breakers and other time dependent events which happen all-the-time and in many instances at the same time.

Is Akka used for scheduling in spark?

Spark uses Akka basically for scheduling. All the workers request for a task to master after registering. The master just assigns the task. Here Spark uses Akka for messaging between the workers and masters.

What is the use of Akka streams?

Core concepts. Akka Streams is a library to process and transfer a sequence of elements using bounded buffer space. This latter property is what we refer to as boundedness, and it is the defining feature of Akka Streams.

Is Akka streams distributed?

Unlike heavier “streaming data processing” frameworks, Akka Streams are neither “deployed” nor automatically distributed.


1 Answers

This is mentioned in a comment but should really by the preferred solution using only akka-streams:

Source.tick(0.seconds, 24.hours, Done).runForeach { x =>
   //do something   
}
like image 54
junkgui Avatar answered Nov 05 '22 21:11

junkgui