code: def with_exit_condition(self, exit_condition: Optional[bool]=True) -> 'MonitorTask':
          
          self._exit_condition = exit_condition
          return self
docs: Sets the flag indicating that the task should also run after the optimisation is ended.