

def connectCached(self, endpoint, protocolFactory, extraWork=(lambda x: x), extraHash=None):
    'See module docstring\n        '
    key = (endpoint, extraHash)
    D = Deferred()
    if (key in self.cachedConnections):
        D.callback(self.cachedConnections[key])
    elif (key in self.inProgress):
        self.inProgress[key].append(D)
    else:
        self.inProgress[key] = [D]
        endpoint.connect(_CachingClientFactory(self, key, protocolFactory, extraWork))
    return D

dataset/ETHPy150Open twisted/vertex/vertex/conncache.py ConnectionCache.connectCached/original