Ouail Bendidi
01/27/2025, 10:44 AMOuail Bendidi
01/27/2025, 10:46 AMif task.isasync:
# TODO: Explore possibly using a long-lived thread with an event loop
# for better performance
future = self._executor.submit(
context.run,
asyncio.run,
run_task_async(**submit_kwargs),
)
else:
future = self._executor.submit(
context.run,
run_task_sync,
**submit_kwargs,
)
I can run them on the flow directly using:
asyncio.gather(*(my_task(xx) for xx in xxs))
but then I would lose the PrefectFuture
interface and the dependency between tasks in the UI