Showing posts with label timeout. Show all posts
Showing posts with label timeout. Show all posts

Jun 6, 2012

Prevent slowness and fail gracefully

interruptingcow

from interruptingcow import timeout

with timeout(20.0, RuntimeError):
    run_something_that_might_take_long()