Async Operations via pydgraph

Does the Python-driver (pydgraph) support async operations? (via asyncio or similar)

I originally asked your support (or whatever that icon in the bottom-right corner is), which pointed me to the ‘async methods’ portion of the python documentation (async: https://dgraph.io/docs/clients/python/#async-methods), but this descibes how to reads a result of such an ‘async’ operation using regular synchronous python-code. I don’t want my python-thread to idle-wait for a response or to guess when the response is ready.

Is the Python-Driver capable of async operations based on the coroutines-spec outlined in PEP 492? (PEP 492 -- Coroutines with async and await syntax | Python.org)
Or is there another way to perform operations on the DB using the Python-driver without having to idle-wait for a response?

2 Likes

I had a look at the codebase and it seems like you are using the old synchronous operations of gRPC to communicate with the Dgraph-Server?
I therefore guess, that integration an this pydgraph into async-code will always result in blocking the whole event-loop until a response is received…
Are there any plans to support the new async-api of gRPC in the future?
([gRPC AsyncIO API — gRPC Python 1.37.0 documentation]