Skip to content
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

Support for gevent, process and threaded drivers #37

Closed
mahendra opened this issue Jul 1, 2013 · 5 comments
Closed

Support for gevent, process and threaded drivers #37

mahendra opened this issue Jul 1, 2013 · 5 comments

Comments

@mahendra
Copy link
Collaborator

mahendra commented Jul 1, 2013

@mumrah I took the branch based on #35 and #36 - and added support for something called drivers.

Basically, if you look at the code base, we use Queue(), Event(), sleep(), socket and multiprocessing.Process() to run the show - workers, multiple-consumers and co-ordination.

Now, Queue, Event, Pool, sleep, socket etc. are provided by multiprocessing, threading and gevent. So, the code can be used as-is (almost) for running it as different process, threads or gevent co-routines.

When SimpleConsumer or MultiConsumer is initialized, we can specify driver = thread / process / gevent and

  • in SimpleConsumer - commit thread will run as a thread/process/gevent-coroutine
  • In MultiConsumer, the various fetches (among which the partitions are distributed) will be run under different threads, processes or gevent co-routines.

The changes are very negligible. The only complexity is in managing the duplicate connections. When a consumer is initialized, an appropriate driver (KafkaDriver) instance is created, which contains the modules that must be used.

Most involved work was in test cases :-)

You can see the diffs here (on top of #35 and #36).
mahendra/kafka-python@mpcommit...gevent

Will send a pull request after they are merged. Later will provide driver support for Producer

@rdiomar
Copy link
Collaborator

rdiomar commented Jan 29, 2014

@mahendra can you please sync this and #39 with master and create a pull request? It would be awesome if we had this!

@rdiomar
Copy link
Collaborator

rdiomar commented Jan 30, 2014

Actually, I need this sooner rather than later so I'll just do it.

@little-arhat
Copy link

What is the state of this issue? Haven't found any notion of "drivers" or "driver_types" in the current HEAD.

@dpkp
Copy link
Owner

dpkp commented Feb 18, 2015

There is no work on this afaik.

@dpkp
Copy link
Owner

dpkp commented Dec 5, 2015

There are no plans to use pluggable driver support. The current client code now has a very simple async io loop. I expect that if we were to implement a full async io stack, we would probably use asyncio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants