bketelsen/skynet — pull request #72 by skelterjohn (2012-07-31 15:23:06+00:00)
Title: rewrite of the resource pooler

This pull request is more of a discussion piece than something I think should go right into the code base.

It changes how the resource pooling is done in a fundamental way: you can always acquire a resource immediately - it will be taken from the idle list or it will be created on the spot. When you release a resource, it is either put in the idle list (if there is room) or closed.

If we decide that we want to put a cap on the number of connections going out from a client to a particular service, this resource pooler is the wrong way to do it (though it could be made to do it). But it will keep a set of connections available so that new ones don't need to be made constantly (and maybe in the future extra authentication and key-exchange steps can be skipped).