Adapter to write documents from a queue to mongodb concurrently
Project description
MongoWriter provides a simple interface to write documents to a mongodb replica set. The interface is an object which behaves like a queue, MongoWriter being the consumer. It tries to handle mongo exceptions (like primary change) gracefully, only dropping documents if the input queue gets full. This is to make a best effort to insert the latest documents in the face of overload or errors but can be disabled by using an unlimited queue.
Gevent
By default MongoWriter uses Threads for its insert workers. Using monkey patches, it works with greenlets as well.
Input Queue
The input object passed to MongoWriter can be anything that acts like a Python queue. The items in the queue are expected to be (collection_name, document) tuples. There is a queue adaptation in mongowriter.util which can be useful for high troughput writing to capped collections.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mongowriter-0.1.6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b815015f032fc774ce71e611c5dce227b8a360ae5dd5c12500bb90cd1e5e836 |
|
MD5 | cfe66108de7c596b9df60d5663104a6e |
|
BLAKE2b-256 | 358c54a95a6587b2c50ef4b0e5f9bb191b066c8d52e5680c36fcbf62d567c6bb |