in tools.py [0:0]
def process_tasks(self, context):
try:
while True:
task = self._task_queue.get_nowait()
func = task["func"]
params = task.get("params") or {}
if callable(func):
result = func(context, **params)
with self._condition:
self._result_dict[task["id"]] = result
self._condition.notify_all()
else:
raise ValueError(f"Task function {func} is not callable")
except queue.Empty:
pass