Handle the outcoming stream.

@internal
431290
public function handleWrite()
    {
        $text = $this->buffer->peek();
        $sent = fwrite($this->resource, $text, $this->bufferSize);

        if ($sent === false)
        {
            $this->emit('error', [ $this, new WriteException('Error occurred while writing to the stream resource.') ]);
            return;
        }

        $lenBefore = strlen($text);
        $lenAfter = $lenBefore - $sent;
        $this->buffer->remove($sent);

        if ($lenAfter > 0 && $lenBefore >= $this->bufferSize && $lenAfter < $this->bufferSize)
        {
            $this->emit('drain', [ $this ]);
        }
        else if ($lenAfter === 0)
        {
            $this->loop->removeWriteStream($this->resource);
            $this->writing = false;
            $this->emit('drain', [ $this ]);
            $this->emit('finish', [ $this ]);
        }
    }
1152626
private function handleSwish() : void
  {
    if (!class_exists(RouterResolver::class)) throw new RouterUnhandledException;

    SwishHandler::setNamespace((new RouterResolver)->getNamespace());
    SwishHandler::fail($this->swishFails());
    SwishHandler::before($this->swishBefore());
    SwishHandler::after($this->swishAfter());
    SwishHandler::view($this->swishView());
  }
854164
public function handleClose()
    {
        $this->pause();

        if (is_resource($this->socket))
        {
            if ($this->getStreamType() === Socket::TYPE_UNIX)
            {
                $path = substr($this->parseEndpoint(), 7);
                unlink($path);
            }
            fclose($this->socket);
        }
    }
1064579
protected function checkStream()
    {
        // Find document content type
        while ( !feof( $this->stream ) )
        {
            $line = fgets( $this->stream );

            // Check if we found a new document definition
            if ( !preg_match( '(^Content-Type:\\s+(?P<type>[a-z*][a-z0-9_/*+.-]*)(;\s*(?P<options>.*))?$)', trim( $line ), $match ) )
            {
                continue;
            }

            $type    = $match['type'];
            $options = isset( $match['options'] ) ? preg_split( '(\s*;\s*)', $match['options'] ) : array();
            foreach ( $options as $option )
            {
                if ( preg_match( '(^(?P<key>[a-z-]+)=("?)(?P<value>.*?)\\2$)', $option, $match ) )
                {
                    $this->options[$match['key']] = $match['value'];
                }
            }

            if ( $type !== 'multipart/mixed' )
            {
                throw new phpillowMultipartParserException( 'This handler does only understand "multipart/mixed" documents.' );
            }

            break;
        }

        // Search for first starting boundary
        while ( !feof( $this->stream ) )
        {
            if ( trim( fgets( $this->stream ) ) === '--' . $this->options['boundary'] )
            {
                break;
            }
        }
    }
1024455
private function stream ()
    {
        $i = $this->start;
        set_time_limit (0);

        while (!feof ($this->stream) && $i <= $this->end) {
            $bytesToRead = $this->buffer;

            if (($i + $bytesToRead) > $this->end)
                $bytesToRead = $this->end - $i + 1;

            $data = fread ($this->stream, $bytesToRead);

            echo $data;
            flush ();

            $i += $bytesToRead;
        }
    }
984733
public function handleShutdown()
    {
        if ( ! is_null($error = error_get_last()) && $this->isFatal($error['type']))
        {
            $log = $this->getLog();
            if ($log instanceof Writer) {
                $log->error($error['message'] . " in " . $error['file'] . " on line " . $error['line']);
            }
        }
    }
5699
public function stream_flush()
    {
        if ($this->fileHandle === null) {
            return false;
        }
        self::restore();
        $success = fflush($this->fileHandle);
        self::register();
        return $success;
    }
1247974
public function handleEvent()
    {
        while ($this->socket !== null)
        {
            $events = $this->socket->getSockOpt(ZMQ::SOCKOPT_EVENTS);

            $hasEvents = ($events & ZMQ::POLL_IN) || ($events & ZMQ::POLL_OUT && $this->buffer->listening);
            if (!$hasEvents)
            {
                break;
            }

            if ($events & ZMQ::POLL_IN)
            {
                $this->handleReadEvent();
            }

            if ($events & ZMQ::POLL_OUT && $this->buffer->listening)
            {
                $this->buffer->handleWriteEvent();
            }
        }
    }
973537
def _handle_streamer_finished(self, index, succeeded, highest_ack):
        """"""

        self._logger.debug("Rolling back streamer %d after streaming, highest ack from streaming subsystem was %d", index, highest_ack)
        self.acknowledge_streamer(index, highest_ack, False)
637907
private function handleClose()
    {
        foreach ($this->timer as $timer) {
            $this->loop->cancelTimer($timer);
        }

        $connection = $this->connection;

        $this->isConnecting = false;
        $this->isDisconnecting = false;
        $this->isConnected = false;
        $this->connection = null;
        $this->stream = null;

        if ($connection !== null) {
            $this->emit('close', [$connection, $this]);
        }
    }
92821
public function handleRemove() {
		$id = $this->request->getQuery("id");
		$token = $this->request->getQuery("token");
		$default = $this->request->getQuery("default", 0);
		
		if($default == 0) {
			$cache = $this->uploadControl->getCache();
			/** @noinspection PhpInternalEntityUsedInspection */
			$cacheFiles = $cache->load($this->uploadControl->getTokenizedCacheName($token));
			if(isset($cacheFiles[ $id ])) {
				/** @noinspection PhpInternalEntityUsedInspection */
				$this->uploadControl->getUploadModel()->remove($cacheFiles[ $id ]);
				unset($cacheFiles[ $id ]);
				/** @noinspection PhpInternalEntityUsedInspection */
				$cache->save($this->uploadControl->getTokenizedCacheName($token), $cacheFiles);
			}
		} else {
			$files = $this->uploadControl->getDefaultFiles();
			
			foreach($files as $file) {
				if($file->getIdentifier() == $id) {
					$file->onDelete($id);
				}
			}
		}
	}
1244075
def abort(self):
        
        err = _pa.Pa_AbortStream(self._stream)
        if err == _pa.paStreamIsStopped:
            return
        self._handle_error(err)
563054
public function handle()
    {
        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->deployer->run($this->getDeployPaths(), []);

        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->deployer->getNotes() as $note) {
            $this->output->writeln($note);
        }
    }
551578
def _handle_continue(self, node, scope, ctxt, stream):
        
        self._dlog("handling continue")
        raise errors.InterpContinue()
158449
private void handleEndOfStream() throws StreamIntegrityException {
    if (endOfStreamHandled) {
      return;
    }

    endOfStreamHandled = true;

    byte[] originalHMAC = trailerIn.getTrailer();
    byte[] calculateHMAC = mac.doFinal();

    if (! AES256JNCryptor.arraysEqual(originalHMAC, calculateHMAC)) {
      throw new StreamIntegrityException("MAC validation failed.");
    }
  }
790087
private function handle()
    {
        if (!$this->handle) {
            if (!($this->handle = @fopen($this->file, 'rb'))) {
                throw FileException::lastError();
            }
        }

        return $this->handle;
    }
636698
protected function handleItself()
    {
        if (!$this->isNew && $this->isCreated($this->event)) {
            $this->unwatch($this->id);
            $this->reindexChildCheckers();
            $this->event = null;
        }
        $this->isNew = false;
    }