From 57e32261c668260b64a088a165e35cdfbaad8294 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Fri, 6 Mar 2020 12:11:22 -0600 Subject: [PATCH] creating processes for the generators --- pipeline.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pipeline.py b/pipeline.py index df92427..c042588 100644 --- a/pipeline.py +++ b/pipeline.py @@ -280,11 +280,21 @@ if __name__ == '__main__' : if ''.join(content).isnumeric() : # # we have partitions we are working with - + make = lambda args: (Components()).generate(args) + jobs = [] + print (["Started ",len(jobs),"generators"]) for id in ''.join(content) : args['partition'] = id + job = Process(target=make,args=(args,args)) - generator.generate(args) + job.start() + jobs.append(job) + + while (len(jobs)> 0) : + jobs = [jobs for job in jobs if job.is_alive()] + time.sleep(2) + + # generator.generate(args) else: generator.generate(args) # Components.generate(args)