Say I have 50 processes, and I'm using them to operate on (say) 20000 different input values. (I'm using the pathos library, which I think operates similarly to the multiprocessing library in Python.)
thread_pool = pathos.multiprocessing.ProcessingPool(threads=50)
thread_pool.map(function, inputs)
I want to create one SQLAlchemy database engine for each process (but I don't have the resources to create one for each input value). Then I want all inputs that are processed using that process to work with the same database engine.
How can I do this?