python-zk / kazoo

Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.
https://kazoo.readthedocs.io
Apache License 2.0
1.3k stars 387 forks source link

Implement simple asyncio wrapper API with basic tests #646

Open Traktormaster opened 3 years ago

Traktormaster commented 3 years ago

Fixes (or attempts to fix) #185 and #499.

Asyncio interoperability is required for what I'm working on, so I've came up with a simple solution. There is no change to the already existing client or handlers. The asyncio client expands on the base threaded implementation. The completely separate implementation ensures no breaking changes.

Python version support

Further work

The KazooRetry implementation cannot be used with the new asyncio API. I'm on the fence about re-implementing it as using a general solution would likely be fine. If I used https://github.com/kaelzhang/python-aioretry for example, it would impose new dependencies though.

More tests would be nice definitely. However the wrapper API is so simple, that it may actually be unnecessary.

I'm going to use a build of this fork. Depending on my experiences I'll likely push updates here as necessary. However, I'm not sure if I'll have time to make this a complete PR with coverage and extended python version support.