title: Implement a watchdog for critical tasks
body: <p>I have an application that sends emails on scheduled times.
  Sometimes the appliction gets stuck while sending an email, I'm still not sure why.</p>
  
  <p>I thought about implementing a simple watchdog like this:
  Before the application starts sending an email, it initializes a new instance of the watchdog.
  This instance starts a one time timer.
  If the task completes OK - we let the watchdog know it should stand down, and it cancels its timer.
  If the timer defined period had elapsed - we exit the program forcefully.</p>
  
  <p>I'm not sure if this is a valid solution or more like a hack, and would appreciate any input regarding
  this subject.</p>
  
  <p>Thanks, Omer</p>