Multiprocessing starmap_async get Pool ID to terminate

94 Views Asked by At

Iam working multiple multiprocessing pool starmap_async which was working fine, but the main issue is, how i can kill only particular pool.

tkinter UI

When i select the Camp1 and run it was running,it select list related to the campaign and running without issue.

self.pool = Pool(processes=10)
p = list(itertools.product(searchengines, selecteddomains, searchterms))
params = [(a, api, name_of_camp, da, pidfileloc, proxies,
                       logfileloc, hours, domainfileloc,
                       siteregistration, mozapi, mozsecret) for a in p]
self.pool.starmap_async(Expired_Search, params)

I cant get the Pool ID to terminate the process. Is there any way to get Pool ID to terminate the process of the campaign i selected.

Any help would be appreciated. Thanks

1

There are 1 best solutions below

0
Naveen On

Found solution with multiprocessing.Process. Thanks to @AKX

self.executor = Process(target=Expired_Search, args=(p, api, name_of_camp, da,
                                                             pidfileloc, proxies,  logfileloc, hours,
                                                             domainfileloc, siteregistration, mozapi, mozsecret))
self.executor.start()