Create an alert dispatcher with cancellation

Here gen.Task() is required because add_timeout is a gen.engine() method. I refactored this code and added comments regarding this.