allow user to give a function to resolve the timeout value instead of a ...

...static value