[][src]Function kwait::poll_immediate

pub fn poll_immediate<F>(
    interval: Duration,
    timeout: Duration,
    condition: F
) -> Result<(), Box<dyn Error>> where
    F: Fn() -> Result<bool, Box<dyn Error>> + Copy

poll_immediate tries a condition func until it returns true, an error, or the timeout is reached.

poll_immediate always checks 'condition' before waiting for the interval. 'condition' will always be invoked at least once.

Some intervals may be missed if the condition takes too long or the time window is too short.

If you want to immediately poll something forever, see poll_immediate_infinite.