If you want to switch from a streaming module to a multiprocessing module for your stream interface, then this is possible. All that needs to be done is to keep track of the PID of each thread / process to start.
from multiprocessing import Process import os,time class myThread(Process): def __init__(self): Process.__init__(self) def run(self): while True: os.system("sleep 5") if __name__ == '__main__': p = myThread() p.start() print "Main thread PID:",os.getpid() print "Launched process PID:",p.pid os.kill(p.pid,1) p.join()
ebarr source share