[PATCH 06 of 23 cubicweb V2] [database/pool] add docstring to _CnxSetPool

Laurent Peuch cortex at worlddomination.be
Fri Jan 17 14:37:03 CET 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1576831069 -3600
#      Fri Dec 20 09:37:49 2019 +0100
# Node ID 7097ddcc444aee07cbec28c4dfae0a24b6a2a345
# Parent  5568552e2e190db9121e08e9a7c15f384b290972
# Available At https://hg.logilab.org/users/lpeuch/cubicweb
#              hg pull https://hg.logilab.org/users/lpeuch/cubicweb -r 7097ddcc444a
[database/pool] add docstring to _CnxSetPool

diff --git a/cubicweb/server/repository.py b/cubicweb/server/repository.py
--- a/cubicweb/server/repository.py
+++ b/cubicweb/server/repository.py
@@ -189,6 +189,22 @@ class _CnxSetPool:
 
     def __init__(self, source, max_size, min_size=3, min_timeout=0.1, max_timeout=5,
                  low_load_delay=30, close_delay=5):
+        """
+        Connection pool for database connection. This pool is a min/max pool
+        that open new connections when the load is to high and start closing it
+        slowly when the load as lower.
+
+        Arguments::
+
+        * source: database source
+        * max_size: maximum number of simultanuous connections
+        * min_size: minimum number of simultanuous connections
+        * min_timeout: time to wait before opening another connection when it's possible
+        * max_timeout: time to wait before raison an exception when the pool is
+          full and not connections are available
+        * low_load_delay: delay before starting to close connections when load is low
+        * close_delay: delay between each connection close
+        """
         self._cnxsets = []
         self.max_size = max_size
         self.min_size = min_size



More information about the cubicweb-devel mailing list