code: def stop(self, *args, **kwargs):
          
          if self.status in (Status.stopping, Status.stopped):
              logger.debug("{} is already {}".format(self, self.status.name))
          else:
              self.status = Status.stopping
              self.onStopping(*args, **kwargs)
              self.status = Status.stopped
docs: Set the status to Status.stopping and also call `onStopping`
          with the provided args and kwargs.