What is the size of the threading default limiter?
Hi all.
When I read the documentation description of anyio.to_thread.run_sync function, it doesn't explicitly state how much default limiter is.
So, I went to the source code and found that limiter = CapacityLimiter(40).
Question:
- Is the size of threading default limiter 40?
- If not, what is the correct threading default limiter?
I hope some kind-hearted people can answer my doubts, thank you very much!
Is the size of threading default limiter 40?
Yes, this is the default thread limiter. It's the same size as in trio.
This seems like a glaring omission in the documentation. I'll keep this issue open until the default limiter has been properly documented.
Thanks to @agronholm for the reply and thanks to the extraordinary anyio.
In my case, the background information is that I am building a RESTful application using FastAPI and I need to evaluate the default thread pool size so that I can better schedule the server resources. As you know, FastAPI's thread pool is dependent on Starlette, and Starlette's thread pool is dependent on anyio(after version 0.15.0).
I think it would be better to specify the default size of the thread pool in the documentation if possible, it will be more friendly.