pub fn run_with_status_check<F, U, C>(
    closure: F,
    interval: Duration,
    continue_fn: C
) -> Result<U>
where F: FnOnce() -> U + Send + 'static, U: Send + 'static, C: FnMut() -> bool,
Expand description

Run the provided closure in a separate thread and return it’s result. If the closure does not finish, continue_fn is called periodically with interval while continue_fn return true. Once continue_fn return false, an Error is returned instead.

WARNING: It is not possible to kill the closure if a timeout occurs. It is advised to panic when an error is returned.