WorkerPool.php
public function registerRead(LoopInterface $loop, callable $listener, $once = false)
    {
        if ($once) {
            $listener2 = function ($worker, $loop) use ($listener) {
                $this->unregisterRead($loop);
                call_user_func($listener, $worker, $loop);
            };
            foreach ($this->workers as $worker) {
                Selectable::registerRead($loop, $worker, $listener2);
            }
        } else {
            foreach ($this->workers as $worker) {
                Selectable::registerRead($loop, $worker, $listener);
            }
        }

        return $this;
    }
public function registerRead(LoopInterface $loop, callable $listener, $once = false)
    {
        if ($once) {
            $listener2 = function ($worker, $loop) use ($listener) {
                $this->unregisterRead($loop);
                call_user_func($listener, $worker, $loop);
            };
            foreach ($this->workers as $worker) {
                Selectable::registerRead($loop, $worker, $listener2);
            }
        } else {
            foreach ($this->workers as $worker) {
                Selectable::registerRead($loop, $worker, $listener);
            }
        }

        return $this;
    }
public function registerRead ( LoopInterface $ loop , callable $ listener , $ once = false ) { if ( $ once ) { $ listener2 = function ( $ worker , $ loop ) use ( $ listener ) { $ this -> unregisterRead ( $ loop ) ; call_user_func ( $ listener , $ worker , $ loop ) ; } ; foreach ( $ this -> workers as $ worker ) { Selectable :: registerRead ( $ loop , $ worker , $ listener2 ) ; } } else { foreach ( $ this -> workers as $ worker ) { Selectable :: registerRead ( $ loop , $ worker , $ listener ) ; } } return $ this ; }
@param LoopInterface $loop
@param callable      $listener
@param bool          $once

@return $this
@param LoopInterface $loop @param callable $listener @param bool $once