wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
529 stars 75 forks source link

Async api? #92

Closed anirudh-chhangani closed 5 years ago

anirudh-chhangani commented 5 years ago

Having async/await support would be great!

maheshnayer commented 5 years ago

+1

wbolster commented 5 years ago

i am not planning to work on this.

since leveldb itself is a synchronous library, at its core this will involve blocking calls to leveldb in any case. i think this means some threading mechanism is needed anyway to run the plyvel/leveldb code in a background thread.

plyvel does release the global interpreter lock (gil) around most relevant calls into the leveldb api, so that would mean the python runtime can do other things while waiting.

so, if people are interested in this, some wrapper layer around plyvel seems the way to go. whether that layer lives inside or outside the plyvel codebase is a technical detail that shouldn't change the overall approach.