code: def _add_async_result(
      cls, result, wait_on_max_results=None, wait_time=30, wait_cb=None
  ):
      while True:
          try:
              cls._async_results_lock.acquire()
              # discard completed results
              pid = os.getpid()
              cls._async_results[pid] = [
                  r
                  for r in cls._async_results.get(pid, [])
                  if not r.ready()
              ]
              num_results = len(cls._async_results[pid])
              if (
                  wait_on_max_results is not None
                  and num_results >= wait_on_max_results
              ):
                  # At least max_results results are still pending, wait
                  if wait_cb:
                      wait_cb(num_results)
                  if wait_time:
                      time.sleep(wait_time)
                  continue
              # add result
              if result and not result.ready():
                  if not cls._async_results.get(pid):
                      cls._async_results[pid] = []
                  cls._async_results[pid].append(result)
              break
          finally:
              cls._async_results_lock.release()
  
file_path: clearml/clearml/utilities/async_manager.py
imports: import os
  import time
  import six
  from .process.mp import SingletonLock
label_desc: Use image node_id 1 for calling the AsyncManagerMixin obj's underlying member method code with example usage: obj._add_async_result(cls, result, wait_on_max_results, wait_time, wait_cb) without return types