Is presidio not async aware in nature? #1629
Unanswered
aashish-chaubey
asked this question in
Q&A
Replies: 1 comment
-
Presidio isn't inherently designed to be asynchronous, but can be extended to run this way. For instance, one can use a different api from the one in app.py (e.g. fast api), or use asyncio (haven't tested this, just for illustration): import asyncio
from presidio_analyzer import AnalyzerEngine
# Initialized once at import time
analyzer = AnalyzerEngine()
async def analyze_text_async(text):
# Wrap the analyze method to run in a thread
return await asyncio.to_thread(analyzer.analyze, text) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am not sure if it is true but what I understand is that
presidio
is not async aware in nature and the main heavy lifting is handled in a thread, not as a true async coroutine.Can anyone please confirm? And if there is a way to make it async-aware, how is that done?
Beta Was this translation helpful? Give feedback.
All reactions