vertx / io.vertx.reactivex.core.streams

Package io.vertx.reactivex.core.streams

Types

Pump

open class Pump

Pumps data from a io.vertx.reactivex.core.streams.ReadStream to a io.vertx.reactivex.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 io.vertx.reactivex.core.streams.ReadStream and write them to a io.vertx.reactivex.core.streams.WriteStream. If data can be read faster than it can be written this could result in the write queue of the io.vertx.reactivex.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 io.vertx.reactivex.core.streams.WriteStream is full, and if so, the io.vertx.reactivex.core.streams.ReadStream is paused, and a drainHandler is set on the io.vertx.reactivex.core.streams.WriteStream.

When the io.vertx.reactivex.core.streams.WriteStream has processed half of its backlog, the drainHandler will be called, which results in the pump resuming the io.vertx.reactivex.core.streams.ReadStream.

This class can be used to pump from any io.vertx.reactivex.core.streams.ReadStream to any io.vertx.reactivex.core.streams.WriteStream, e.g. from an io.vertx.reactivex.core.http.HttpServerRequest to an io.vertx.reactivex.core.file.AsyncFile, or from io.vertx.reactivex.core.net.NetSocket to a io.vertx.reactivex.core.http.WebSocket.

Please see the documentation for more information.

NOTE: This class has been automatically generated from the io.vertx.core.streams.Pump non RX-ified interface using Vert.x codegen.

ReadStream

interface ReadStream<T : Any> : StreamBase

Represents a stream of items that can be read from.

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

NOTE: This class has been automatically generated from the io.vertx.core.streams.ReadStream non RX-ified interface using Vert.x codegen.

StreamBase

interface StreamBase

Base interface for a stream. NOTE: This class has been automatically generated from the io.vertx.core.streams.StreamBase non RX-ified interface using Vert.x codegen.

WriteStream

interface WriteStream<T : Any> : StreamBase

Represents a stream of data that can be written to.

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

NOTE: This class has been automatically generated from the io.vertx.core.streams.WriteStream non RX-ified interface using Vert.x codegen.