Add Alarm/Timeout Support #342

derks opened this Issue Feb 19, 2016 · 0 comments


None yet
1 participant

derks commented Feb 19, 2016

Useful to handle script timeouts using signal.alarm but might be a wider usecase to simply support timing out any operation within the app. Something like:

with CementApp('myapp') as app:
    # fail after 5 minutes (300 seconds)

Wrapping the functionality of:

import signal

def timeout_handler(signum, frame):
    Raise Exception('Operation Timed Out')

with CementApp('myapp') as app:
    # fail after 5 minutes (300 seconds)
    signal.signal(signal.SIGALRM, timeout_handler)


Note that handling the signal is already possible with the builtin CementApp signal handling mechanisms. Also note that signal.alarm is only available on Unix/Linux.

@derks derks added this to the 2.8.0 Stable milestone Feb 19, 2016

@derks derks self-assigned this Feb 19, 2016

derks added a commit that referenced this issue Feb 22, 2016

@derks derks closed this Feb 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment