AsyncNdiClient exposes the same namespaces and methods as NdiClient, using
await for network calls. Use it for web services, concurrent document
processing, or any application that already runs an asyncio event loop.
Basic usage
client.documents.parse(...) becomes
await client.documents.parse(...), and client.jobs.iter_all() is consumed
with async for.
Process documents concurrently
Share one client across tasks. Each operation creates its own job, and eachjobs.wait polls independently.
Limit concurrency
Use anasyncio.Semaphore when processing a large batch. This bounds the
number of jobs submitted at once and helps your application stay within its
NDI concurrent-job limit.
jobs.wait.
Handle partial batch failures
By default,asyncio.gather raises when one task fails. Use
return_exceptions=True when each document should succeed or fail
independently.
Close the client
Preferasync with, which closes the SDK-owned httpx.AsyncClient. If you
cannot use a context manager, call await client.aclose().
httpx.AsyncClient, you own its lifecycle.
When to use async
Use AsyncNdiClient
Concurrent batches, FastAPI or other async services, and applications that
already use asyncio.
Use NdiClient
One-off scripts, notebooks, and sequential processing where async would add
unnecessary complexity.