[][src]Function kwait::poll

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

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

poll always waits the interval before the run of 'condition'. '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 poll something forever, see poll_infinite.