private function parse(string $data = "")
    {
        try {
            $promise = $this->requestParser->send($data);

            if ($promise instanceof Promise && !$this->isExported && !($this->status & self::CLOSED_RDWR)) {
                // Parser wants to wait until a promise completes.
                $this->paused = true;
                $promise->onResolve($this->resume); // Resume will set $this->paused to false if called immediately.
                if ($this->paused) { // Avoids potential for unnecessary disable followed by enable.
                    Loop::disable($this->readWatcher);
                }
            }
        } catch (\Throwable $exception) {
            // Parser *should not* throw an exception, but in case it does...
            $this->logger->critical($exception);
            $this->close();
        }
    }
private function parse(string $data = "")
    {
        try {
            $promise = $this->requestParser->send($data);

            if ($promise instanceof Promise && !$this->isExported && !($this->status & self::CLOSED_RDWR)) {
                // Parser wants to wait until a promise completes.
                $this->paused = true;
                $promise->onResolve($this->resume); // Resume will set $this->paused to false if called immediately.
                if ($this->paused) { // Avoids potential for unnecessary disable followed by enable.
                    Loop::disable($this->readWatcher);
                }
            }
        } catch (\Throwable $exception) {
            // Parser *should not* throw an exception, but in case it does...
            $this->logger->critical($exception);
            $this->close();
        }
    }
private function parse ( string $ data = "" ) { try { $ promise = $ this -> requestParser -> send ( $ data ) ; if ( $ promise instanceof Promise && ! $ this -> isExported && ! ( $ this -> status & self :: CLOSED_RDWR ) ) { // Parser wants to wait until a promise completes. $ this -> paused = true ; $ promise -> onResolve ( $ this -> resume ) ; // Resume will set $this->paused to false if called immediately. if ( $ this -> paused ) { // Avoids potential for unnecessary disable followed by enable. Loop :: disable ( $ this -> readWatcher ) ; } } } catch ( \ Throwable $ exception ) { // Parser *should not* throw an exception, but in case it does... $ this -> logger -> critical ( $ exception ) ; $ this -> close ( ) ; } }
Sends data to the request parser.

@param string $data
Sends data to the request parser .