class documentation

class SingletonThreadPool(Pool):

View In Hierarchy

A Pool that maintains one connection per thread.

Maintains one connection per each thread, never moving a connection to a thread other than the one which it was created in.

Warning

the .SingletonThreadPool will call .close() on arbitrary connections that exist beyond the size setting of pool_size, e.g. if more unique thread identities than what pool_size states are used. This cleanup is non-deterministic and not sensitive to whether or not the connections linked to those thread identities are currently in use.

.SingletonThreadPool may be improved in a future release, however in its current status it is generally used only for test scenarios using a SQLite :memory: database and is not recommended for production use.

Options are the same as those of _pool.Pool, as well as:

.SingletonThreadPool is used by the SQLite dialect automatically when a memory-based database is used. See :ref:`sqlite_toplevel`.

Parameters
pool​_sizeThe number of threads in which to maintain connections at once. Defaults to five.
Method __init__ Undocumented
Method ​_cleanup Undocumented
Method ​_do​_get Undocumented
Method ​_do​_return​_conn Undocumented
Method ​_return​_conn Undocumented
Method connect Undocumented
Method dispose Dispose of this pool.
Method recreate Undocumented
Method status Undocumented
Class Variable ​_is​_asyncio Undocumented
Instance Variable ​_all​_conns Undocumented
Instance Variable ​_conn Undocumented
Instance Variable ​_fairy Undocumented
Instance Variable size Undocumented
def __init__(self, creator, pool_size=5, **kw):

Undocumented

def _cleanup(self):

Undocumented

def _do_get(self):

Undocumented

def _do_return_conn(self, conn):

Undocumented

def _return_conn(self, record):

Undocumented

def connect(self):

Undocumented

def dispose(self):
Dispose of this pool.
def recreate(self):

Undocumented

def status(self):

Undocumented

_is_asyncio: bool =

Undocumented

_all_conns: set =

Undocumented

_conn =

Undocumented

_fairy =

Undocumented

size =

Undocumented