Public Vars

Back

wait-predicate (clj)

(source)

function

(wait-predicate pred) (wait-predicate pred opts)
Wakes up every `:interval` seconds to call `pred`. Keeps this up until either `pred` returns true or `:timeout` has elapsed. When `:timeout` has elapsed a slingshot exception is throws with `:message`. Arguments: - `pred`: a zero-argument predicate to call - `opts`: a map of optional parameters: - `:timeout` wait limit in seconds, [[*wait-timeout*]] by default; - `:interval` how long to wait between calls, [[*wait-interval*]] by default; - `:message` a message that becomes a part of exception when timeout is reached.

Examples