Skip to content

vahagnni/pyfunc-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Function timeout

For killing python long running functions, when alarm syngal won't help. Decorator allows you to kill process max in 15 seconds, after timeout expires. Such big time conditioned by the fact that decorator doing some tries to terminate process gracefully, before killing it with SIGKILL.

Usage

from ftimout import timeout
from time import sleep

# 20 minutes
@timeout(20 * 60)
def long_function():
    while True:
    	sleep(10)
        print "Next loop"

About

python decorator for function timeout

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages