FSX/momoko — pull request #60 by haizaar (2014-02-04 08:10:34+00:00)
Title: Volatile db, pool stretching and other goodies

Hi Frank,
This is kind of a bold code change. Feature summary:
* Pool reconnects to database if connections become broken
* Pool now supports stretching - up to `max_size` connections will be open if all initial connections are in use
* Switched to subscription based model using Futures for connections waiting
* Explicit managing of free/busy connections - one connection allocated per operation. This how it was working before anyway, but this approach also eliminates subtle transaction related bugs that were reported earlier.
* Finally, PEP8 compliance :)

I hope you'll have a time to review it soon.

Unitests pass (except for Mogrify test, which also fails on your master and 1.0.0). Connections resiliency was tested by me manually - I'm not sure how to create unit tests for this, since it involves shutting down database server (unless we'll launch our own psql server during unittest).