thread-utilsπ i
Roman Klochkov <kalimehtar@mail.ru>
This package provides some utilities to do common patterns of async programming.
func:(->any/c)
on-error:any/c=#f
Calls func and wait for answer not more then timeout.
If func fails to complete until that moment and on-error is a procedure, then returns (on-error#f). If func raise an exception,
applies on-error to the exception and returns it’s result. If on-error any other value, then it will be returned in
case of error or timeout.
func:(->any/c)
on-error:any/c=#f
Returns thread, which runs func in infinite loop. When func raises an exception, applies
on-error to the exception and run func again. If on-error is not a procedure, then errors are supressed.