Allows to set a Handler
which is notified once the write queue is
drained again.
Exception handler.
Pumps data from a org.vertx.scala.core.streams.ReadStream to a org.vertx.scala.core.streams.WriteStream and performs flow control where necessary to prevent the write stream buffer from getting overfull.
Pumps data from a org.vertx.scala.core.streams.ReadStream to a org.vertx.scala.core.streams.WriteStream and performs flow control where necessary to prevent the write stream buffer from getting overfull.
Instances of this class read bytes from a org.vertx.scala.core.streams.ReadStream and write them to a org.vertx.scala.core.streams.WriteStream. If data can be read faster than it can be written this could result in the write queue of the org.vertx.scala.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
org.vertx.scala.core.streams.WriteStream is full, and if so, the
org.vertx.scala.core.streams.ReadStream is paused, and a drainHandler
is set on the
org.vertx.scala.core.streams.WriteStream. When the org.vertx.scala.core.streams.WriteStream
has processed half of its backlog, the drainHandler
will be
called, which results in the pump resuming the org.vertx.scala.core.streams.ReadStream.
This class can be used to pump from any org.vertx.scala.core.streams.ReadStream to any org.vertx.scala.core.streams.WriteStream, e.g. from an org.vertx.scala.core.http.HttpServerRequest to an org.vertx.scala.core.file.AsyncFile, or from org.vertx.scala.core.net.NetSocket to a org.vertx.scala.core.http.WebSocket.
Instances of this class are not thread-safe.
Represents a stream of data that can be read from.
Represents a stream of data that can be read from.
Any class that implements this interface can be used by a org.vertx.scala.core.streams.Pump to pump data from it to a org.vertx.scala.core.streams.WriteStream.
This interface exposes a fluent api and the type T represents the type of the object that implements the interface to allow method chaining
Allows to set a handler which is notified once data was read.
Allows to set a handler which is notified once data was read. It also allows to pause reading and resume later.
Represents a stream of data that can be written to
Represents a stream of data that can be written to
Any class that implements this interface can be used by a org.vertx.scala.core.streams.Pump to pump data from a org.vertx.scala.core.streams.ReadStream to it.
This interface exposes a fluent api and the type T represents the type of the object that implements the interface to allow method chaining
Allows to set a
Handler
which is notified once the write queue is drained again. This way you can stop writing once the write queue consumes to much memory and so prevent an OutOfMemoryError.