I want to put the function abc running in parallel, and the task ppm.abc in the apply_async doesn't perform and I'm only getting the error_calback value.
I've tried to run the function outside the apply_async, and it runs perfectly. Does anyone know what the problem is?Here is the code
if __name__ == "__main__":
start_time = time.time()
pool = multiprocessing.Pool(processes=multiprocessing.cpu_count()-1)
ppm=PPM()
for p in range(len(routes)):
pool.apply_async(ppm.abc,args=(p), callback=ppm.collect_results,error_callback=ppm.custom_error_callback)
pool.close()
pool.join()