This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from concurrent.futures import ThreadPoolExecutor as Executor | |
from time import sleep | |
def async_map(executor: Executor, mapper, data): | |
return [executor.submit(mapper, datum) for datum in data] | |
def report_progress(futures, tag, callback): |