I have a twisted server application that maintains persistent connections with around 1000 clients. Each client will occasionally send data to my twisted server, and I would like that server to store data into a MongoDB database. So far, so good.
But, the pymongo documentation states something like "there is no good way to use pymongo with twisted". I don't understand why not. Can someone please explain what exactly the problem is and what the pitfalls are? I think it has something to do with pymongo being synchronous, but all I want to do is shove some stuff into the database.
If I have a single instance of pymongo.MongoClient declared in a file connector.py, and then I import connector into the main python file that runs my Twisted factory and protocols, I should be able to use that instance of pymongo.MongoClient in each Protocol (connection to each client) to store the data to the database.
So what exactly is the problem? Obviously I'm a bit confused.