Classes, interfaces and traits

Pump

Pumps data from a @see \io\vertx\jphp\core\streams\ReadStream to a @see \io\vertx\jphp\core\streams\WriteStream and performs flow control where necessary to prevent the write stream buffer from getting overfull.

Instances of this class read items from a @see \io\vertx\jphp\core\streams\ReadStream and write them to a @see \io\vertx\jphp\core\streams\WriteStream. If data can be read faster than it can be written this could result in the write queue of the @see \io\vertx\jphp\core\streams\WriteStream growing without bound, eventually causing it to exhaust all available RAM.

To prevent this, after each write, instances of this class check whether the write queue of the @see \io\vertx\jphp\core\streams\WriteStream is full, and if so, the @see \io\vertx\jphp\core\streams\ReadStream is paused, and a drainHandler is set on the

« More »

ReadStream

Represents a stream of items that can be read from.

Any class that implements this interface can be used by a @see \io\vertx\jphp\core\streams\Pump to pump data from it to a @see \io\vertx\jphp\core\streams\WriteStream.

Streaming mode

The stream is either in flowing or fetch mode.
    Initially the stream is in flowing mode.
  • When the stream is in flowing mode, elements are delivered to the handler.
  • When the stream is in fetch mode, only the number of requested elements will be delivered to the handler.
The mode can be changed with the @see \io\vertx\jphp\core\streams\ReadStream::pause, @see \io\vertx\jphp\core\streams\ReadStream::resume and @see \io\vertx\jphp\core\streams\ReadStream::fetch methods:
  • Calling @see \io\vertx\jphp\core\streams\ReadStream::resume sets the flowing mode
  • Calling @see \io\vertx\jphp\core\streams\ReadStream::pause sets the fetch mode and resets the demand to 0
  • Calling @see \io\vertx\jphp\core\streams\ReadStream::fetch requests a specific amount of elements and adds it to the actual demand
« More »

StreamBase

Base interface for a stream.

« More »

WriteStream

Represents a stream of data that can be written to.

Any class that implements this interface can be used by a @see \io\vertx\jphp\core\streams\Pump to pump data from a ReadStream to it.

« More »