title: Akka Actor Retry on Failure
body: <p>I have an Actor that gets a message called Init and upon receiving this message, it tries to create a connection to an external service. Now this connection could succeed or fail and I know this information in my Actor:</p>
  
  <pre><code>def receive = {
    case Init =&gt; {
      val someConn: Option[Connection] = createConnection(...)
      someConn match {
        case Some(conn) =&gt; {
          // do something
        }
        case None =&gt; // I want to re-try Init, but after a few seconds delay!
    }
  }
  </code></pre>
  
  <p>Upon None, I would like to send a self message to this actor with an Init message again, but I would not like to do it immediately. I would like to have a delay of few seconds, say 10 seconds. Any suggestions?</p>