@@ -14,22 +14,22 @@ for threaded applications.
1414How does connection pooling work in PyMongo?
1515--------------------------------------------
1616
17- Every :class: `~pymongo.connection.Connection ` instance has built-in
17+ Every :class: `~pymongo.mongo_client.MongoClient ` instance has built-in
1818connection pooling. By default, each thread gets its own socket reserved on its
1919first operation. Those sockets are held until
20- :meth: `~pymongo.connection.Connection .end_request ` is called by that
20+ :meth: `~pymongo.mongo_client.MongoClient .end_request ` is called by that
2121thread.
2222
23- Calling :meth: `~pymongo.connection.Connection .end_request ` allows the
23+ Calling :meth: `~pymongo.mongo_client.MongoClient .end_request ` allows the
2424socket to be returned to the pool, and to be used by other threads
2525instead of creating a new socket. Judicious use of this method is
2626important for applications with many threads or with long running
2727threads that make few calls to PyMongo operations.
2828
29- Alternatively, a :class: `~pymongo.connection.Connection ` created with
29+ Alternatively, a :class: `~pymongo.mongo_client.MongoClient ` created with
3030``auto_start_request=False `` will share sockets (safely) among all threads.
3131
32- When :meth: `~pymongo.connection.Connection .disconnect ` is called by any thread,
32+ When :meth: `~pymongo.mongo_client.MongoClient .disconnect ` is called by any thread,
3333all sockets are closed. PyMongo will create new sockets as needed.
3434
3535Does PyMongo support Python 3?
@@ -47,7 +47,7 @@ Currently there is no great way to use PyMongo in conjunction with `Tornado
4747<http://www.tornadoweb.org/> `_ or `Twisted <http://twistedmatrix.com/ >`_.
4848PyMongo provides built-in connection pooling, so some of the benefits of those
4949frameworks can be achieved just by writing multi-threaded code that shares a
50- :class: `~pymongo.connection.Connection `.
50+ :class: `~pymongo.mongo_client.MongoClient `.
5151
5252There are asynchronous MongoDB drivers in Python: `AsyncMongo for Tornado
5353<https://github.com/bitly/asyncmongo> `_ and `TxMongo for Twisted
@@ -62,10 +62,10 @@ avoid blocking the event loop:
6262 `MongoDB profiler <http://www.mongodb.org/display/DOCS/Database+Profiler >`_
6363 to watch for slow queries.
6464
65- - Create a single :class: `~pymongo.connection.Connection ` instance for your
65+ - Create a single :class: `~pymongo.mongo_client.MongoClient ` instance for your
6666 application in your startup code, before starting the IOLoop.
6767
68- - Configure the :class: `~pymongo.connection.Connection ` with a short
68+ - Configure the :class: `~pymongo.mongo_client.MongoClient ` with a short
6969 ``socketTimeoutMS `` so slow operations result in a
7070 :class: `~pymongo.errors.TimeoutError `, rather than blocking the loop and
7171 preventing your application from responding to other requests.
@@ -145,9 +145,9 @@ UTC. In versions >= 1.7, the driver will automatically convert aware
145145datetimes to UTC before saving them. By default, datetimes retrieved
146146from the server (no matter what version of the driver you're using)
147147will be naive and represent UTC. In newer versions of the driver you
148- can set the :class: `~pymongo.connection.Connection ` `tz_aware `
148+ can set the :class: `~pymongo.mongo_client.MongoClient ` `tz_aware `
149149parameter to ``True ``, which will cause all
150- :class: `~datetime.datetime ` instances returned from that Connection to
150+ :class: `~datetime.datetime ` instances returned from that MongoClient to
151151be aware (UTC). This setting is recommended, as it can force
152152application code to handle timezones properly.
153153
0 commit comments