Rename to "set_func_timeout" - Give it 2 possible arguments. First is either a floating point timeout, or a function which will be invoked each call of decorated function and passed same arguments, to calculate the timeout that should be used. Second is "allowOverride", default False. If True, adds a kwarg to the function being decorated, "forceTimeout", which if provided will override any default timeout and prevent a calculation attempt.
16 lines
517 B
Python
16 lines
517 B
Python
'''
|
|
Copyright (c) 2016, 2017 Tim Savannah All Rights Reserved.
|
|
|
|
Licensed under the Lesser GNU Public License Version 3, LGPLv3. You should have recieved a copy of this with the source distribution as
|
|
LICENSE, otherwise it is available at https://github.com/kata198/func_timeout/LICENSE
|
|
'''
|
|
|
|
|
|
__version__ = '4.0.0'
|
|
__version_tuple__ = (4, 0, 0)
|
|
|
|
__all__ = ('func_timeout', 'func_set_timeout', 'FunctionTimedOut')
|
|
|
|
from .exceptions import FunctionTimedOut
|
|
from .dafunc import func_timeout, func_set_timeout
|