'Thread-safe multiget implementation that shares the same thread pool
for all requests.'

def multiget(self, bucket, keys, headers=None, **kwargs):

    requests = [(key, self.build_url(bucket, key, kwargs), Event()) for key in keys]
    results = {}
    def callback(key, event, rv):
        results[key] = rv
        event.set()
    for (key, url, event) in requests:
        self.pool.submit((self.manager.urlopen, ('GET', url), {'headers': headers}, functools.partial(callback, key, event)))
    for (_, _, event) in requests:
        event.wait()
    return results
