src/Comodojo/Daemon/Worker/Manager.php
public function install(
        WorkerInterface $worker,
        $looptime = 1,
        $forever = false
    ) {

        $name = $worker->getName();

        if ( $this->isInstalled($name) ) {
            throw new Exception("Worker already installed");
        }

        $w = Worker::create()
            ->setInstance($worker)
            ->setLooptime($looptime)
            ->setForever($forever)
            ->setInputChannel(new SharedMemory((int) '1'.hexdec($worker->getId())))
            ->setOutputChannel(new SharedMemory((int) '2'.hexdec($worker->getId())));

        $this->data[$name] = $w;

        return $this;

    }
public function install(
        WorkerInterface $worker,
        $looptime = 1,
        $forever = false
    ) {

        $name = $worker->getName();

        if ( $this->isInstalled($name) ) {
            throw new Exception("Worker already installed");
        }

        $w = Worker::create()
            ->setInstance($worker)
            ->setLooptime($looptime)
            ->setForever($forever)
            ->setInputChannel(new SharedMemory((int) '1'.hexdec($worker->getId())))
            ->setOutputChannel(new SharedMemory((int) '2'.hexdec($worker->getId())));

        $this->data[$name] = $w;

        return $this;

    }
public function install ( WorkerInterface $ worker , $ looptime = 1 , $ forever = false ) { $ name = $ worker -> getName ( ) ; if ( $ this -> isInstalled ( $ name ) ) { throw new Exception ( "Worker already installed" ) ; } $ w = Worker :: create ( ) -> setInstance ( $ worker ) -> setLooptime ( $ looptime ) -> setForever ( $ forever ) -> setInputChannel ( new SharedMemory ( ( int ) '1' . hexdec ( $ worker -> getId ( ) ) ) ) -> setOutputChannel ( new SharedMemory ( ( int ) '2' . hexdec ( $ worker -> getId ( ) ) ) ) ; $ this -> data [ $ name ] = $ w ; return $ this ; }
Install a worker into the stack

@param WorkerInterface $worker
@param int $looptime
@param bool $forever
@return Manager
Install a worker into the stack