The docs say PyMuPDF does not support running on multiple threads.
I am running in async context
async def handle_request(path: str):
await asyncio.to_thread(extract_pdf(path))
def extract_pdf(path: str):
with pymupdf.open(path) as pdf:
do_extract()
Is this pattern inherently unsafe because of the asyncio.to_thread? Even though no pymupdf objects are shared across thread boundaries?
The docs say
PyMuPDF does not support running on multiple threads.I am running in async context
Is this pattern inherently unsafe because of the asyncio.to_thread? Even though no pymupdf objects are shared across thread boundaries?