I'm trying to create a scheduler in my akka typed just to test it out, like to run every x seconds.
def start(): Behavior[ClientMsg] = Behaviors.setup { ctx =>
ctx.log.info("start() called")
ctx.system.scheduler.scheduleAtFixedRate(30.seconds, 5000.millis) { () =>
ctx.self ! TestMessage(""""this is pretty cool"""")
}
}
I am getting an error saying an implicit execution context is not in scope.
Where should I get the execution context from when inside of an typed actor? Also, is this how I should be setting up a scheduler/timer?