-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gevent implementation of kafka-python #145
Conversation
I have problem with this pull request.
from kafka.green import KafkaClient, SimpleProducer
kafka = KafkaClient("localhost:9092")
producer = SimpleProducer(kafka, req_acks=SimpleProducer.ACK_NOT_REQUIRED, async=True) Basically because of two calls of conn.collect_hosts func. |
Should be fixed in the latest commit. |
probably should have some unit tests. also assume we would not add gevent to install requirements (but probably should be added to test requirements). and also think an addition to README is warranted if this gets merged. |
also -- there are currently some merge conflicts. please rebase and resolve |
I am going to withdraw this request in favor of just using the gevent library's monkey patch feature. That just seems simpler. The copy() methods on KafkaConnection and KafkaClient don't work with gevent, but I will submit a patch for that shortly. |
I implemented API KEY 35 from the official Apache Kafka documentation. This functionality is requested in issue # 2163 and this is an implementation proposal. Co-authored-by: chopatate <florian.courouge@outlook.fr>
I implemented API KEY 35 from the official Apache Kafka documentation. This functionality is requested in issue # 2163 and this is an implementation proposal. Co-authored-by: chopatate <florian.courouge@outlook.fr>
This adds a 'green' submodule to kafka-python, which uses the gevent python library (www.gevent.org) constructs for certain classes. The only classes I ported over right now are Producer, SimpleProducer, KeyedProducer, KafkaConnection and KafkaClient.
To use the submodule, simply do replace
import kafka
with
import kafka.green as kafka
Comments welcome!