Kevin Cen
07/19/2024, 7:59 PMno current event loop in thread.Jian Shen Yap
07/22/2024, 6:08 AManyio from_thread or to_thread to manage async job? there is some intricacies within BentoML with async/sync conversion which we use anyio to manageKevin Cen
07/22/2024, 8:38 PMthreading package works, but I would like to ideally do it without the use of threads. I have tried asyncio and anyio but both resulted in issues.Jian Shen Yap
07/23/2024, 2:06 PMfrom anyio import from_thread
from_thread.run(xxxx)
should do the job and is the recommended way. Could you maybe share your code and maybe we can walk through togetherJian Shen Yap
07/23/2024, 2:07 PMthreading is another way to make it work and its actually quite reliable as long as you are not doing any thread unsafe operationsKevin Cen
07/23/2024, 2:35 PMfrom_thread.run(xxxx) block the current process until the function has concluded? My background task is meant to run indefinitely until the service ends so this would not be a feasible solution for my use case.