title: Is it possible to use the Akka scheduler inside an actor?
body: <p>I want to have the possibility to put actors to sleep for a while. The actors should decide themselves how long they are going to sleep. As Thread.sleep() is not a recommended way of doing this I thought of using the scheduler in akka. I therefore defined an actor were another actor can register for being woken up.</p>
  
  <pre><code>class Scheduler extends Actor {
  
    def receive = {
      case Sleep(duration) =&gt; context.system.scheduler.scheduleOnce(duration) {
        sender ! Ring
      }
    }
  }
  </code></pre>
  
  <p>But the sending actor never receives the Ring message. 
  So my questions are</p>
  
  <ul>
  <li>Is scheduling with the scheduler recommended inside an actor?</li>
  <li>Why is the sending actor never receiving the Ring message?</li>
  <li>If this is not possible what is the recommended way of solving the problem?</li>
  </ul>