creating processes for the generators

This commit is contained in:
Steve Nyemba 2020-03-06 12:11:22 -06:00
parent 8c5193cb6d
commit 57e32261c6
1 changed files with 12 additions and 2 deletions

View File

@ -280,11 +280,21 @@ if __name__ == '__main__' :
if ''.join(content).isnumeric() : if ''.join(content).isnumeric() :
# #
# we have partitions we are working with # we have partitions we are working with
make = lambda args: (Components()).generate(args)
jobs = []
print (["Started ",len(jobs),"generators"])
for id in ''.join(content) : for id in ''.join(content) :
args['partition'] = id 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: else:
generator.generate(args) generator.generate(args)
# Components.generate(args) # Components.generate(args)