]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Docs pool cleanup
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 27 Jul 2021 19:51:36 +0000 (21:51 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 27 Jul 2021 19:51:36 +0000 (21:51 +0200)
docs/advanced/pool.rst
docs/api/pool.rst
psycopg/psycopg/pool/pool.py

index dcdf046a754ffe9351682cd9ce2cf545dd26848e..541a24cc3d7abfd530b8c76e1f14e81e0d5e9947 100644 (file)
@@ -109,7 +109,7 @@ to restart it.
 If more than *min_size* connections are requested concurrently, new ones are
 created, up to *max_size*. Note that the connections are always created by the
 background workers, not by the thread asking the connection: if a client
-requires a new connection, and a previous client terminates its job before the
+requests a new connection, and a previous client terminates its job before the
 new connection is ready, the waiting client will be served the existing
 connection. This is especially useful in scenarios where the time to connect
 is longer than the time the connection is used (see `this analysis`__, for
index bf6451166d48ef19fab28285c8122901bb83c339..140899e9b3cc4b20352b925c8a20d130612581ae 100644 (file)
@@ -11,7 +11,7 @@ creates and maintains a limited amount of PostgreSQL connections and allows a
 larger number of users to use them. See :ref:`connection-pools` for more
 details and usage pattern.
 
-There package implement two connection pools: `ConnectionPool` is a
+This module implement two connection pools: `ConnectionPool` is a
 synchronous connection pool yielding `~psycopg.Connection` objects and can be
 used by multithread applications. `AsyncConnectionPool` has a similar
 interface, but with `asyncio` functions replacing blocking functions, and
@@ -89,8 +89,8 @@ The `!ConnectionPool` class
    :type timeout: `!float`, default: 30 seconds
 
    :param max_waiting: Maximum number of requests that can be queued to the
-                       pool. Requesting will fail, raising `TooManyRequests`.
-                       0 means no queue limit.
+                       pool, after which new requests will fail, raising
+                       `TooManyRequests`. 0 means no queue limit.
    :type max_waiting: `!int`, default: 0
 
    :param max_lifetime: The maximum lifetime of a connection in the pool, in
@@ -176,6 +176,8 @@ The `!ConnectionPool` class
    .. automethod:: getconn
    .. automethod:: putconn
 
+Pool exceptions
+---------------
 
 .. autoclass:: PoolTimeout()
 
@@ -195,8 +197,8 @@ The `!AsyncConnectionPool` class
 
 `!AsyncConnectionPool` has a very similar interface to the `ConnectionPool`
 class but its blocking method are implemented as `async` coroutines. It
-returns `AsyncConnection` instances, or its subclasses if specified so in the
-*connection_class* parameter.
+returns `~psycopg.AsyncConnection` instances, or its subclasses if specified
+so in the *connection_class* parameter.
 
 Only the function with different signature from `!ConnectionPool` are
 listed here.
index 2de6918ead16e0d0ce63c4d8740525ff0121bee3..7ba7d3d013cf68cd4affae1f7ed68225bb2f4027 100644 (file)
@@ -132,7 +132,7 @@ class ConnectionPool(BasePool[Connection[Any]]):
     ) -> Iterator[Connection[Any]]:
         """Context manager to obtain a connection from the pool.
 
-        Returned the connection immediately if available, otherwise wait up to
+        Return the connection immediately if available, otherwise wait up to
         *timeout* or `self.timeout` seconds and throw `PoolTimeout` if a
         connection is not available in time.
 
@@ -261,9 +261,9 @@ class ConnectionPool(BasePool[Connection[Any]]):
         with a `PoolClosed` exception. Currently used connections will not be
         closed until returned to the pool.
 
-        Wait *timeout* for threads to terminate their job, if positive. If
-        timeout expires the pool is closed anyway, although it may raise some
-        warnings on exit.
+        Wait *timeout* seconds for threads to terminate their job, if positive.
+        If the timeout expires the pool is closed anyway, although it may raise
+        some warnings on exit.
         """
         if self._closed:
             return