ccs-twistedextensions
ccs-twistedextensions copied to clipboard
add an explicit threadpool argument to ConnectionPool initializer
exarkun@… originally submitted this as ticket:835
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.