ConnectionPool has a reactor (class) attribute that initializes to the global reactor. It uses this for IReactorThreads (to thread the actual SQL execution) and IReactorTime (to schedule reconnection attempts).
This makes it possible to fake things out for unit testing purposes, but not super convenient. Twisted itself doesn't include a good fake of IReactorThreads.
It seems ConnectionPool.__init__ could accept an (optional) ThreadPool instance to use instead of the IReactorThreads implementation of ConnectionPool.reactor.
exarkun@… originally submitted this as ticket:835
ConnectionPool
has areactor
(class) attribute that initializes to the global reactor. It uses this forIReactorThreads
(to thread the actual SQL execution) andIReactorTime
(to schedule reconnection attempts).This makes it possible to fake things out for unit testing purposes, but not super convenient. Twisted itself doesn't include a good fake of
IReactorThreads
.It seems
ConnectionPool.__init__
could accept an (optional)ThreadPool
instance to use instead of theIReactorThreads
implementation ofConnectionPool.reactor
.