try-until - calling a function repeatedly until either a predefined condition is met or a given number of tries is exceeded