[zeromq-dev] MongoDB driver with pyzmq

MinRK benjaminrk at gmail.com
Thu Jan 13 22:55:28 CET 2011


On Wed, Jan 12, 2011 at 13:53, Dan Yamins <dyamins at gmail.com> wrote:

> Hi all:
>
> I've written an asynchronous MongoDB driver to work with Tornado event
> loops, using regular nonblocking sockets.     Basically what I've done is
> tak the pymongo driver, detach the two ends of the "send_and_receive_msg"
> method, and replace it with two separate "send" and "receive" methods, one
> of which gets hooked up to the callback on a tornado ioloop.
>

A pyzmq MongoDB driver would be seriously excellent. We have discussed doing
this sometime in the future, but we haven't learned enough about MongoDB to
get started.  Thanks for reading our minds!


>
>
> Currently the use of regular non-blocking sockets causes some problems and
>  I'd like to make it better by using zmq.    My hope was to:
>
> 1) replace the regular tornado IO loop with the pyzmq one
> 2) replace the regular sockets  with zmq streams (i think).
>

Yes, this should be the right approach.  The pyzmq IOLoop should drop in to
Tornado just fine (this hasn't really been tested).  ZMQStreams are the
wrappers for zmq sockets that work with the IOLoop via callbacks, etc.


>
> Is this reasonable?  Are there issues I don't understand?  (I've never used
> zmq at all before, and know very little about message structure in
> general).
>

I think you have the right idea, and I hope it goes well.

-MinRK



>
> Thanks!
> Dan
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110113/f93c10c9/attachment.htm>


More information about the zeromq-dev mailing list