API for cpu bound task #1866
-
Hi I'd like to ask introducing new API to support pure CPU intensive (which is not blocking I/O) task. In ML domain (from FastAPI), each ML serving server is trying to solve this problem introducing specific APIs (basically based on multiprocessing). I think if starlette can provide general API to support such task, it would affect greatly to entire community powered by FastAPI. To be specific, I want to ask it's viable to use Any advice would be appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think the background task processors like RQ or Celery are better suited for this. |
Beta Was this translation helpful? Give feedback.
I think the background task processors like RQ or Celery are better suited for this.
Having it as a part of Starlette can lead to high resource usage because in concurrent environment you can spawn a lot of subprocesses and we would need some mechanism to control process concurrency which is out of scope of web framework.