how do i use gridfs
with libraries that dont accept non-blocking gridfs and only non-blocking other calls?
i got error:
from mongotor.database import Database
import gridfs
db = Database.connect("localhost:27017", "mydb")
fs = gridfs.GridFS(db)
---------------------------------------------------------------------------
TypeError
Traceback (most recent call last)
<ipython-input-4-e0f456d7d574> in <module>()
----> 1 fs = gridfs.GridFS(db)
C:\Python27\lib\site-packages\pymongo-2.3_-py2.7-win-amd64.egg\gridfs\__init__.pyc in __init__(self, database, collection)
49 """
50 if not isinstance(database, Database):
---> 51 raise TypeError("database must be an instance of Database")
52
53 self.__database = database
TypeError: database must be an instance of Database
Do i understand that gridfs MUST use only BLOCKING databases? (pymongo)
so then, do i use pymongo and mongotor, then i got:
from mongotor.database import Database
from pymongo import Connection
import gridfs
db = Database.connect("localhost:27017", "mydb")
dbb = Connection().mydb
fs = gridfs.GridFS(dbb)
So dbb
will only be used when there is images to provide? it will block the db calls of course? so if someone is requesting picture then my non-blocking calls will block?