def METHOD_NAME(self):
    """
    Stops the scheduler.
    """
    self.stop_event.set()
    # This is kind of a hack, but it awakens all threads so they stop
    # immediately
    self.new_earlier_event.set()