I made a toolbox script that uses multiprocessing. The tool runs fine if left to complete but if the cancelled button is pressed I can't get it terminate the pool. I am fairly new to python and arcpy, but I did find the env.autoCancelling and env.isCancelled and have tried that but not very successfully.
simplified example (not actual code)
arcpy.env.autoCancelling = False
NUM_FINISHED = 0
FINISHED = False
NUM_FINISHED += 1
if NUM_FINISHED == 10
FINISHED = True
''' do stuff here'''
def main(peram_one, peram_two)
pool = multiprocessing.pool(10)
for i in range(10):
pool.apply_async(process_stuff, args=(peram_one, peram_two), callback=on_complete)
in_feature = arcpy.GetPerameterAsText(0)
to_buffer = arcpy.GetPerameter(1)
When the cancel button is pressed, the processes are sill running and never cancel and the cpu stays at 100% even though they become completely detached from ArcCatalog and the GUI from ArcCatalog shows that it was cancelled. What am I missing?