From e4b02581413cffc9019c866eee75aa9f026c9238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Sat, 30 Jul 2022 12:54:20 +0200 Subject: [PATCH] fixed docs for CPManager --- CHANGELOG.md | 5 +++-- satella/coding/resources/cp_manager.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2af0b596..972a8fe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -# v2.20.4 +# v2.21.1 * removed the decorator syntax for transaction, it''s confusing and contrary to Zen of Python -* fixed some random bug-4444444- \ No newline at end of file +* fixed some random bug +* fixed docs for CPManager diff --git a/satella/coding/resources/cp_manager.py b/satella/coding/resources/cp_manager.py index 24b75e24..6dd0daca 100644 --- a/satella/coding/resources/cp_manager.py +++ b/satella/coding/resources/cp_manager.py @@ -26,6 +26,12 @@ class CPManager(Monitor, Closeable, tp.Generic[T], metaclass=abc.ABCMeta): Note that you have to overload :meth:`~satella.coding.resources.CPManager.teardown_connection` and :meth:`~satella.coding.resources.CPManager.create_connection`. + You obtain a connection by using :meth:`~satella.coding.resources.CPManager.acquire_connection`. + If it fails you should mark it as such using + :meth:`~satella.coding.resources.CPManager.fail_connection`. + In all cases you have to return it using + :meth:`~satella.coding.resources.CPManager.release_connection`. + :param max_number: maximum number of connections :param max_cycle_no: maximum number of get/put connection cycles. -- GitLab