Return the total number of bytes pumped by this pump.
Set the write queue max size to maxSize
Start the Pump.
Start the Pump. The Pump can be started and stopped multiple times.
Stop the Pump.
Stop the Pump. The Pump can be started and stopped multiple times.
Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types
Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types
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, thedrainHandler
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.