PHPDaemon\Core\ComplexJob::more PHP Метод

more() публичный Метод

Sets a callback which is going to be fired always when we have a room for more jobs
public more ( callable $cb = null ) : this
$cb callable Callback
Результат this
    public function more($cb = null)
    {
        if ($cb !== null) {
            $this->more = $cb;
            $this->moreFirstFlag = true;
            return $this;
        }
        if ($this->more !== null) {
            if ($this->more instanceof \Iterator) {
                iterator:
                $it = $this->more;
                while (!$this->isQueueFull() && $it->valid()) {
                    if ($this->moreFirstFlag) {
                        $this->moreFirstFlag = false;
                    } else {
                        $it->next();
                        if (!$it->valid()) {
                            break;
                        }
                    }
                    $this->addJob($it->key(), $it->current());
                }
            } else {
                $func = $this->more;
                if (($r = $func($this)) instanceof \Iterator) {
                    $this->more = $r;
                    goto iterator;
                }
            }
        }
        return $this;
    }