class_docstr: Abstraction for ML task. Should have interface similat to concurrent.futures.Future
  
  Attributes:
      db (Redis): database object
      redis_key (RedisKey): redis keys associated with task
      dataframe (DataFrame): task result
      exception (Exception): task exeuton  runtime exception
      _timeout (int): max time without status updating
docstr: block threasd untill task is not done or failed
          
docstr_tok: ["block","threasd","untill","task","is","not","done","or","failed"]
code: def wait(
      self, status: ML_TASK_STATUS = ML_TASK_STATUS.COMPLETE
  ) -> None:
      """block threasd untill task is not done or failed"""
      for status in self.subscribe():
          if status in (
              ML_TASK_STATUS.WAITING,
              ML_TASK_STATUS.PROCESSING,
          ):
              continue
          if status == ML_TASK_STATUS.ERROR:
              if self.exception is not None:
                  raise self.exception
              else:
                  raise Exception(
                      "Unknown error during ML task execution"
                  )
          if status == ML_TASK_STATUS.TIMEOUT:
              raise Exception(
                  f"Can't get answer in {self._timeout} seconds"
              )
          if status == ML_TASK_STATUS.COMPLETE:
              return
          raise KeyError("Unknown task status")
  
file_path: mindsdb/mindsdb/utilities/ml_task_queue/task.py
imports: from collections.abc import Callable
  import redis
  from pandas import DataFrame
  from mindsdb.utilities.ml_task_queue.utils import RedisKey, from_bytes
  from mindsdb.utilities.ml_task_queue.const import ML_TASK_STATUS
label_desc: Use image node_id 3 for calling the Task obj's underlying member method code with example usage: obj.wait(status) without return types