'Retrieves a server conn from the pool, or connects a new one.
Chooses the server based on a consistent hash of "key".'

def _get_conns(self, key):

    pos = bisect(self._sorted, key)
    served = []
    while (len(served) < self._tries):
        pos = ((pos + 1) % len(self._sorted))
        server = self._ring[self._sorted[pos]]
        if (server in served):
            continue
        served.append(server)
        if (self._error_limited[server] > time.time()):
            continue
        sock = None
        try:
            with MemcachePoolTimeout(self._pool_timeout):
                (fp, sock) = self._client_cache[server].get()
            (yield (server, fp, sock))
        except MemcachePoolTimeout as e:
            self._exception_occurred(server, e, action='getting    a    connection', got_connection=False)
        except (Exception, Timeout) as e:
            self._exception_occurred(server, e, action='connecting', sock=sock)
