protected function executeNextJob(): void
    {
        while ($this->jobs) {
            $job = \array_pop($this->jobs);
            
            if ($job->state & AbstractPromise::PENDING) {
                $done = false;
                
                (new Coroutine($job->context, $job->generator))->when(function (?\Throwable $e, $v = null) use ($job, & $done) {
                    if ($e) {
                        $job->fail($e);
                    } else {
                        $job->resolve($v);
                    }
                    
                    if ($done) {
                        $this->executeNextJob();
                    } else {
                        $done = true;
                    }
                });
                
                if (!$done) {
                    $done = true;
                    
                    return;
                }
            }
        }
        
        $this->running--;
    }
protected function executeNextJob(): void
    {
        while ($this->jobs) {
            $job = \array_pop($this->jobs);
            
            if ($job->state & AbstractPromise::PENDING) {
                $done = false;
                
                (new Coroutine($job->context, $job->generator))->when(function (?\Throwable $e, $v = null) use ($job, & $done) {
                    if ($e) {
                        $job->fail($e);
                    } else {
                        $job->resolve($v);
                    }
                    
                    if ($done) {
                        $this->executeNextJob();
                    } else {
                        $done = true;
                    }
                });
                
                if (!$done) {
                    $done = true;
                    
                    return;
                }
            }
        }
        
        $this->running--;
    }
protected function executeNextJob ( ) : void { while ( $ this -> jobs ) { $ job = \ array_pop ( $ this -> jobs ) ; if ( $ job -> state & AbstractPromise :: PENDING ) { $ done = false ; ( new Coroutine ( $ job -> context , $ job -> generator ) ) -> when ( function ( ? \ Throwable $ e , $ v = null ) use ( $ job , & $ done ) { if ( $ e ) { $ job -> fail ( $ e ) ; } else { $ job -> resolve ( $ v ) ; } if ( $ done ) { $ this -> executeNextJob ( ) ; } else { $ done = true ; } } ) ; if ( ! $ done ) { $ done = true ; return ; } } } $ this -> running -- ; }
Execute the queued job with the highest priority.
Execute the queued job with the highest priority .