You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to use DocxTemplate inside my async FastAPI endpoint but since it's blocking I have to make my FastAPI endpoint synchronous which will create additional thread. I don't want to use up all my threads when getting many requests.
Describe the solution you'd like
If I could simply await the DocxTemplate and all it's methods this would be no problem.
Describe alternatives you've considered
Maybe use aiofiles or something / not sure about this
@ugoi@waketzheng fyi, I'm adding render_async() and save_async() to Docform (the maintained fork at https://github.com/cvas22/docform, docform on PyPI) in cvas22/docform#200. They run in a worker thread with an optional executor to limit concurrency, so you can switch over once it's released.
Activity
waketzheng commentedon Sep 24, 2025
@ugoi fastapi depends on anyio, you can do it like this:
To control the concurrency number:
cvas22 commentedon Nov 23, 2026
@ugoi @waketzheng fyi, I'm adding
render_async()andsave_async()to Docform (the maintained fork at https://github.com/cvas22/docform,docformon PyPI) in cvas22/docform#200. They run in a worker thread with an optional executor to limit concurrency, so you can switch over once it's released.cvas22 commentedon Nov 23, 2026
@ugoi @waketzheng merged in Docform in cvas22/docform#200, it'll be in the next
docformrelease.