simpleflow icon indicating copy to clipboard operation
simpleflow copied to clipboard

Add timeout around execution of external Python program

Open benjastudio opened this issue 8 years ago • 0 comments

It would be useful to let the user define a timeout value when using the decorator @execute.python().

Eg:

import time
def sleep_and_return(seconds):
    time.sleep(seconds)
    return seconds

func = execute.python(timeout=0.5)(sleep_and_return)  # <== adding a new "timeout" parameter
result = func(10)  # <== It would be nice to raise after 0.5 seconds.

benjastudio avatar Aug 10 '17 16:08 benjastudio