Skip to content

Instantly share code, notes, and snippets.

I would recommend Dask for this sort of work as it is easy to produce a task graph and minimise computation overhead

import dask


def A(argument):
    print('Running A with', argument)
    return argument
@DomHudson
DomHudson / custom_worker_processes.py
Last active July 18, 2023 17:12
Multiprocessing in Python with Custom Workers
import random
import multiprocessing
context = multiprocessing.get_context()
class Worker(context.Process):
def __init__(self, *args, **kwargs):