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
see |
When the @see \io\vertx\jphp\core\streams\WriteStream has processed half of its backlog, the This class can be used to pump from any @see \io\vertx\jphp\core\streams\ReadStream to any @see \io\vertx\jphp\core\streams\WriteStream, e.g. from an @see \io\vertx\jphp\core\http\HttpServerRequest to an @see \io\vertx\jphp\core\file\AsyncFile, or from @see \io\vertx\jphp\core\net\NetSocket to a @see \io\vertx\jphp\core\http\WebSocket. Please see the documentation for more information. |
---|---|
package |
Default |
__construct()
numberPumped() : integer
integer
pump( $arg0, $arg1, $arg2 = null) : \io\vertx\jphp\core\streams\Pump
param $rs [ReadStream
Create a new Pump
with the given ReadStream
and WriteStream
and
writeQueueMaxSize
param $rs [ReadStream
ReadStream
WriteStream
integer
\io\vertx\jphp\core\streams\Pump
the pump
setWriteQueueMaxSize( $arg0) : $this
integer
$this
a reference to this, so the API can be used fluently
start() : $this
$this
a reference to this, so the API can be used fluently
stop() : $this
$this
a reference to this, so the API can be used fluently