(PUP-744) Create a pool of puppet HTTP connections
This commit adds a pool for caching puppet network connections. The pool
maintains a hash indexed by site. Each site refers to an array of
sessions, where each session refers to a puppet HTTP connection and its
timeout.
It is expected the consumers of the pool will follow the pattern:
conn = pool.take_connection(site) # do something with conn pool.add_connection(site, conn)
Whenever a connection is (re-)added to the pool, the pool will assign a
expiration timeout. When a caller next requests a connection, the pool
will lazily close any expired connection(s) for that site.
The timeout exists, because if there is a long delay between the time
that an open connection is added to the pool and when it is taken, the
remote peer may close the connection, e.g. apache. As a result, we
only want to cache connections for a short time. Currently the timeout
defaults to 15 seconds.