UrbanIndo\Yii2\Queue\Queue::fetch PHP 메소드

fetch() 공개 메소드

Return next job from the queue. This will trigger event EVENT_BEFORE_FETCH and event EVENT_AFTER_FETCH
public fetch ( ) : UrbanIndo\Yii2\Queue\Job | boolean
리턴 UrbanIndo\Yii2\Queue\Job | boolean the job or false if not found.
    public function fetch()
    {
        $this->trigger(self::EVENT_BEFORE_FETCH);
        $job = $this->fetchJob();
        if ($job == false) {
            return false;
        }
        $this->trigger(self::EVENT_AFTER_FETCH, new Event(['job' => $job]));
        return $job;
    }