Anything that blocks the thread is not recommended in Akka. If the actor has a common thread pool configured (the default behavior), then using Thread.sleep will keep the thread from that pool, which could do the work for other actors.
If you really need to block, then an actor can have its own thread. This can be done by setting up a user manager for use by the actor, full details are here .
A recognized alternative to blocking is scheduling an actor’s callback via a timer, for example, sending a message after 5 seconds.
akkaSystem.scheduler.scheduleOnce(5 seconds, actor, "msgFoo")
Akka scheduler is described here: http://doc.akka.io/docs/akka/2.3.6/scala/scheduler.html
Chris k
source share