private function subscribeStreamEvent($stream, $flag)
    {
        $key = (int) $stream;

        if (isset($this->streamEvents[$key])) {
            $event = $this->streamEvents[$key];
            $flags = ($this->streamFlags[$key] |= $flag);

            $event->del();
            $event->set($this->eventBase, $stream, Event::PERSIST | $flags, $this->streamCallback);
        } else {
            $event = new Event($this->eventBase, $stream, Event::PERSIST | $flag, $this->streamCallback);

            $this->streamEvents[$key] = $event;
            $this->streamFlags[$key] = $flag;
        }

        $event->add();
    }
private function subscribeStreamEvent($stream, $flag)
    {
        $key = (int) $stream;

        if (isset($this->streamEvents[$key])) {
            $event = $this->streamEvents[$key];
            $flags = ($this->streamFlags[$key] |= $flag);

            $event->del();
            $event->set($this->eventBase, $stream, Event::PERSIST | $flags, $this->streamCallback);
        } else {
            $event = new Event($this->eventBase, $stream, Event::PERSIST | $flag, $this->streamCallback);

            $this->streamEvents[$key] = $event;
            $this->streamFlags[$key] = $flag;
        }

        $event->add();
    }
private function subscribeStreamEvent ( $ stream , $ flag ) { $ key = ( int ) $ stream ; if ( isset ( $ this -> streamEvents [ $ key ] ) ) { $ event = $ this -> streamEvents [ $ key ] ; $ flags = ( $ this -> streamFlags [ $ key ] |= $ flag ) ; $ event -> del ( ) ; $ event -> set ( $ this -> eventBase , $ stream , Event :: PERSIST | $ flags , $ this -> streamCallback ) ; } else { $ event = new Event ( $ this -> eventBase , $ stream , Event :: PERSIST | $ flag , $ this -> streamCallback ) ; $ this -> streamEvents [ $ key ] = $ event ; $ this -> streamFlags [ $ key ] = $ flag ; } $ event -> add ( ) ; }
Create a new ext-event Event object, or update the existing one.

@param stream  $stream
@param integer $flag   Event::READ or Event::WRITE
Create a new ext - event Event object or update the existing one .