Package buildbot :: Package process :: Module mtrlogobserver :: Class EqConnectionPool
[frames] | no frames]

Class EqConnectionPool

source code

twisted.enterprise.adbapi.ConnectionPool --+
                                           |
                                          EqConnectionPool

This class works the same way as twisted.enterprise.adbapi.ConnectionPool. But it adds the ability to compare connection pools for equality (by comparing the arguments passed to the constructor).

This is useful when passing the ConnectionPool to a BuildStep, as otherwise Buildbot will consider the buildstep (and hence the containing buildfactory) to have changed every time the configuration is reloaded.

It also sets some defaults differently from adbapi.ConnectionPool that are more suitable for use in MTR.

Instance Methods
 
__init__(self, *args, **kwargs)
Create a new ConnectionPool.
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code

Inherited from twisted.enterprise.adbapi.ConnectionPool: __getstate__, __setstate__, close, connect, disconnect, finalClose, runInteraction, runOperation, runQuery, runWithConnection, start

Class Variables

Inherited from twisted.enterprise.adbapi.ConnectionPool: CP_ARGS, good_sql, max, min, name, noisy, openfun, reconnect, running

Instance Variables

Inherited from twisted.enterprise.adbapi.ConnectionPool: connectionFactory, shutdownID, transactionFactory

Method Details

__init__(self, *args, **kwargs)
(Constructor)

source code 

Create a new ConnectionPool.

Any positional or keyword arguments other than those documented here are passed to the DB-API object when connecting. Use these arguments to pass database names, usernames, passwords, etc.

Parameters:
  • dbapiName - an import string to use to obtain a DB-API compatible module (e.g. 'pyPgSQL.PgSQL')
  • cp_min - the minimum number of connections in pool (default 3)
  • cp_max - the maximum number of connections in pool (default 5)
  • cp_noisy - generate informational log messages during operation (default False)
  • cp_openfun - a callback invoked after every connect() on the underlying DB-API object. The callback is passed a new DB-API connection object. This callback can setup per-connection state such as charset, timezone, etc.
  • cp_reconnect - detect connections which have failed and reconnect (default False). Failed connections may result in ConnectionLost exceptions, which indicate the query may need to be re-sent.
  • cp_good_sql - an sql query which should always succeed and change no state (default 'select 1')
  • cp_reactor - use this reactor instead of the global reactor (added in Twisted 10.2).
Overrides: twisted.enterprise.adbapi.ConnectionPool.__init__
(inherited documentation)