Open konstantin-baidin-y42 opened 9 months ago
A little update: I found that this code works with Uvicorn and Daphne. I don't know what is exact difference. I suppose Uvicorn and Daphne don't spawn workers and work as a single process. That is why there is no daemonic process error.
But I would like to keep hypercorn as I use quart framework. Is there a way to run hypercorn as a single process, without spawning a worker? I don't need multiple workers.
@pgjones Looks like Hypercorn worker processes are by default run with daemon
set (ref). This prevents APIs like multiprocessing.Process / concurrent.futures.ProcessPoolExecutor
from creating children processes from inside the application.
Is there any reason why worker processes need to be daemon
ized or if this flag could be configured? Note that this is not the case with application servers like uWSGI
or uvicorn
.
@konstantin-baidin-y42 Were you able to workaround this issue?
@konstantin-baidin-y42 Were you able to workaround this issue?
Finally, I just switched my service to uvicorn
, it works well for me 🤷♂️
Hello, attempt to use ProcessPoolExecutor leads to
ThreadPoolExecutor could work here, but it doesn't suit me, because I have a CPU-bound heavy function, so it must be a separate process instead of a thread.
Example of application:
Is there a way to use ProcessPoolExecutor in the web-apps served by hypercorn?