def pktCap(self, filter="", packetcount=10, timeout=60, srcip="", dstip=""): pool = ThreadPool(processes=1) p = pktcap() # create new thread/process for the packet capture async_result = pool.apply_async(p.capture, (filter, timeout, packetcount, srcip, dstip,)) # slepp for a second to allow everything to get set up time.sleep(1) return async_result