BigQuery/src/JobWaitTrait.php
private function wait(
        callable $isCompleteFn,
        callable $reloadFn,
        Job $job,
        $maxRetries
    ) {
        if (!$isCompleteFn()) {
            if ($maxRetries === null) {
                $maxRetries = Job::MAX_RETRIES;
            }

            $retryFn = function () use ($isCompleteFn, $reloadFn, $job) {
                $reloadFn();

                if (!$isCompleteFn()) {
                    throw new JobException('Job did not complete within the allowed number of retries.', $job);
                }
            };

            (new ExponentialBackoff($maxRetries))
                ->execute($retryFn);
        }
    }
private function wait(
        callable $isCompleteFn,
        callable $reloadFn,
        Job $job,
        $maxRetries
    ) {
        if (!$isCompleteFn()) {
            if ($maxRetries === null) {
                $maxRetries = Job::MAX_RETRIES;
            }

            $retryFn = function () use ($isCompleteFn, $reloadFn, $job) {
                $reloadFn();

                if (!$isCompleteFn()) {
                    throw new JobException('Job did not complete within the allowed number of retries.', $job);
                }
            };

            (new ExponentialBackoff($maxRetries))
                ->execute($retryFn);
        }
    }
private function wait ( callable $ isCompleteFn , callable $ reloadFn , Job $ job , $ maxRetries ) { if ( ! $ isCompleteFn ( ) ) { if ( $ maxRetries === null ) { $ maxRetries = Job :: MAX_RETRIES ; } $ retryFn = function ( ) use ( $ isCompleteFn , $ reloadFn , $ job ) { $ reloadFn ( ) ; if ( ! $ isCompleteFn ( ) ) { throw new JobException ( 'Job did not complete within the allowed number of retries.' , $ job ) ; } } ; ( new ExponentialBackoff ( $ maxRetries ) ) -> execute ( $ retryFn ) ; } }
Waits for an operation to complete.

@param callable $isCompleteFn
@param callable $reloadFn
@param Job $job
@param int $maxRetries
@throws JobException
Waits for an operation to complete .