class_docstr: Concurrent event loop context.
  
  Args:
      concurrency: max processing concurrency.
docstr: Adds an asynchronized coroutine task to run.
  
  Args:
      coro: The asynchronous coroutine function.
      callback (callable, optional): The callback function applied on the
          returned results after the coroutine task is finished.
          (default: :obj:`None`)
  
  Note that any result returned by :obj:`callback` will be ignored.
docstr_tok: ["Adds","an","asynchronized","coroutine","task","to","run",".","Args",":","coro",":","The","asynchronous","coroutine","function",".","callback","(","callable",",","optional",")",":","The","callback","function","applied","on","the","returned","results","after","the","coroutine","task","is","finished",".","(","default",":",":","obj",":","`","None","`",")","Note","that","any","result","returned","by",":","obj",":","`","callback","`","will","be","ignored","."]
code: def add_task(self, coro, callback: Optional[Callable] = None):
      r"""Adds an asynchronized coroutine task to run.
  
      Args:
          coro: The asynchronous coroutine function.
          callback (callable, optional): The callback function applied on the
              returned results after the coroutine task is finished.
              (default: :obj:`None`)
  
      Note that any result returned by :obj:`callback` will be ignored.
      """
  
      def on_done(f: asyncio.futures.Future):
          try:
              res = f.result()
              if callback is not None:
                  callback(res)
          except Exception as e:
              logging.error(f"Coroutine task failed with error: {e}")
          self._sem.release()
  
      self._sem.acquire()
      fut = asyncio.run_coroutine_threadsafe(coro, self._loop)
      fut.add_done_callback(on_done)
  
file_path: pytorch_geometric/torch_geometric/distributed/event_loop.py
imports: import asyncio
  import atexit
  import logging
  from threading import BoundedSemaphore, Thread
  from typing import Callable, Optional
  import torch
label_desc: Use image node_id 4 for calling the ConcurrentEventLoop obj's underlying member method code with example usage: obj.add_task(coro, callback) without return types