def run_keepedalive_process(main_write_pipe, process_read_pipe, obj):
    """
    Procees who don't finish while job to do
    """
    while obj != 'stop':
        oneshot_in_process(obj)
        # Send to main process "I've done my job"
        main_write_pipe.send('job is done')
        # Wait for new job to do (this part can be simplified no ?)
        readers = [process_read_pipe]
        while readers:
            for r in wait(readers):
                try:
                    obj = r.recv()
                except EOFError:
                    pass
                finally:
                    readers.remove(r)
def run_keepedalive_process ( main_write_pipe , process_read_pipe , obj ) : while obj != 'stop' : oneshot_in_process ( obj ) main_write_pipe . send ( 'job is done' ) readers = [ process_read_pipe ] while readers : for r in wait ( readers ) : try : obj = r . recv ( ) except EOFError : pass finally : readers . remove ( r )
Procees who don't finish while job to do