Command/WorkerTenderCommand.php
private function familyPlanning()
    {
        list($total, $available) = $this->countWorkers();
        if ($this->shutdownGracefully) {
            if ($total > 0) {
                $this->verboseOutput("<info>Shutting down</info> $total remaining children");
                foreach ($this->family as $cnr => $child) {
                    $this->verboseOutput("<info>Child: $cnr </info>" . $child->status);
                }
                $this->tellChildrenToPrepareForBed();

            } else {
                $this->keepWorking = false;
            }
            return;
        }
        list($shouldHaveLessWorkers, $shouldHaveMoreWorkers) = $this->moreOrLess($total, $available);
        if ($shouldHaveMoreWorkers) {
            $this->family[] = $this->spawnChild();
        }
        if ($shouldHaveLessWorkers) {
            //find one of the family members not doing anything and cap it!
            if ($this->findDisposableWorkers()) {
                //we found one
                $this->verboseOutput("<info>Found a disposable worker</info>");
            }
        }
    }
private function familyPlanning()
    {
        list($total, $available) = $this->countWorkers();
        if ($this->shutdownGracefully) {
            if ($total > 0) {
                $this->verboseOutput("<info>Shutting down</info> $total remaining children");
                foreach ($this->family as $cnr => $child) {
                    $this->verboseOutput("<info>Child: $cnr </info>" . $child->status);
                }
                $this->tellChildrenToPrepareForBed();

            } else {
                $this->keepWorking = false;
            }
            return;
        }
        list($shouldHaveLessWorkers, $shouldHaveMoreWorkers) = $this->moreOrLess($total, $available);
        if ($shouldHaveMoreWorkers) {
            $this->family[] = $this->spawnChild();
        }
        if ($shouldHaveLessWorkers) {
            //find one of the family members not doing anything and cap it!
            if ($this->findDisposableWorkers()) {
                //we found one
                $this->verboseOutput("<info>Found a disposable worker</info>");
            }
        }
    }
private function familyPlanning ( ) { list ( $ total , $ available ) = $ this -> countWorkers ( ) ; if ( $ this -> shutdownGracefully ) { if ( $ total > 0 ) { $ this -> verboseOutput ( "<info>Shutting down</info> $total remaining children" ) ; foreach ( $ this -> family as $ cnr => $ child ) { $ this -> verboseOutput ( "<info>Child: $cnr </info>" . $ child -> status ) ; } $ this -> tellChildrenToPrepareForBed ( ) ; } else { $ this -> keepWorking = false ; } return ; } list ( $ shouldHaveLessWorkers , $ shouldHaveMoreWorkers ) = $ this -> moreOrLess ( $ total , $ available ) ; if ( $ shouldHaveMoreWorkers ) { $ this -> family [ ] = $ this -> spawnChild ( ) ; } if ( $ shouldHaveLessWorkers ) { //find one of the family members not doing anything and cap it! if ( $ this -> findDisposableWorkers ( ) ) { //we found one $ this -> verboseOutput ( "<info>Found a disposable worker</info>" ) ; } } }
Produce more hands for the work needed

@return void
Produce more hands for the work needed