src/Keboola/Writer/GoodData/Client.php
public function waitForJob($url)
    {
        $jobFinished = false;
        $i = 1;
        do {
            $jobInfo = $jobInfo = $this->get($url)->send()->json();
            if (isset($jobInfo['status']) && !in_array($jobInfo['status'], ['waiting', 'processing'])) {
                $jobFinished = true;
            }
            if (!$jobFinished) {
                usleep((1 << $i) * 1000000 + rand(0, 1000000));
            }
            $i++;
        } while (!$jobFinished);

        return $jobInfo;
    }
public function waitForJob($url)
    {
        $jobFinished = false;
        $i = 1;
        do {
            $jobInfo = $jobInfo = $this->get($url)->send()->json();
            if (isset($jobInfo['status']) && !in_array($jobInfo['status'], ['waiting', 'processing'])) {
                $jobFinished = true;
            }
            if (!$jobFinished) {
                usleep((1 << $i) * 1000000 + rand(0, 1000000));
            }
            $i++;
        } while (!$jobFinished);

        return $jobInfo;
    }
public function waitForJob ( $ url ) { $ jobFinished = false ; $ i = 1 ; do { $ jobInfo = $ jobInfo = $ this -> get ( $ url ) -> send ( ) -> json ( ) ; if ( isset ( $ jobInfo [ 'status' ] ) && ! in_array ( $ jobInfo [ 'status' ] , [ 'waiting' , 'processing' ] ) ) { $ jobFinished = true ; } if ( ! $ jobFinished ) { usleep ( ( 1 << $ i ) * 1000000 + rand ( 0 , 1000000 ) ) ; } $ i ++ ; } while ( ! $ jobFinished ) ; return $ jobInfo ; }
Ask repeatedly for job status until it is finished
@param $url
@return array
Ask repeatedly for job status until it is finished