I'm trying to schedule random messages with Akka scheduler.schedule, something like:
system.scheduler.schedule(1 second, 5 seconds, actorRef,
scala.util.Random.nextInt(50))
The problem is that the "Int" reference gets caught and the message the scheduler sends is always the same number. In other words, the random number is only generated once.
I can't come up with a workaround for that. Any help?