Skip to content

Instantly share code, notes, and snippets.

View firezdog's full-sized avatar

Alex Leibowitz firezdog

View GitHub Profile
@firezdog
firezdog / map_reduce.py
Created November 6, 2022 19:52
Simple Implementation of MapReduce In Python
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):