def __init__(self, *args, **kwargs):
"""Create a new connection to a single MongoDB instance at *host:port*.
MotorClient takes the same constructor arguments as
:class:`~pymongo.mongo_client.MongoClient`, as well as:
:Parameters:
- `io_loop` (optional): Special :class:`tornado.ioloop.IOLoop`
instance to use instead of default
"""
if 'io_loop' in kwargs:
io_loop = kwargs.pop('io_loop')
else:
io_loop = ioloop.IOLoop.current()
event_class = functools.partial(util.MotorGreenletEvent, io_loop)
kwargs['_event_class'] = event_class
super(MotorClient, self).__init__(io_loop, *args, **kwargs)
评论列表
文章目录