'Gets a connection from the pool for the named host.  Returns
None if there is no connection that can be reused. It\'s the caller\'s
responsibility to call close() on the connection when it\'s no longer
needed.'

def get_http_connection(self, host, port, is_secure):

    self.clean()
    with self.mutex:
        key = (host, port, is_secure)
        if (key not in self.host_to_pool):
            return None
        return self.host_to_pool[key].get()
