title: Check if a Scala / Akka actor is terminated
body: <p>While executing code within one actor, I need to check if the actor is still alive.
  Would this be advisable or is there a better way?</p>
  
  <pre><code>if (self != akka.actor.DeadLetter) {
    // do something
  }
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>EDIT---</p>
  
  <p>Thanks for all your inputs. What happens is the following. I am using Play. As my actor starts, upon an incoming request, a timeout is scheduled.</p>
  
  <pre><code>Promise.timeout({
       Logger.info(s"$self, timeout expired")
       // do something
  }, timeoutValue)
  </code></pre>
  
  <p>Sometimes the actor is stopped for other reasons before the timeout expires (for instance, the client disconnects). In that case, what I see then in the logs is</p>
  
  <pre><code>Actor[akka://application/deadLetters], timeout expired.
  </code></pre>
  
  <p>To my understanding, this means that the default <code>deadLetters</code> actor is executing that code. So my question really is: what is the best way to check if the Promise code is executed after the actor is terminated, and prevent it from going further if that is the case?    </p>