Retry a callable with exponential backoff

for ($i = 0; $i < 5; $i++) {
    try {
        return $fn();
    } catch (RuntimeException $e) {
        usleep(random_int(0, (2 ** $i) * 1000000));
    }
}

throw $e;