Class Pump
- All Implemented Interfaces:
MutinyDelegate
ReadStream
to a WriteStream
and performs flow control where necessary to
prevent the write stream buffer from getting overfull.
Instances of this class read items from a ReadStream
and write them to a WriteStream
. If data
can be read faster than it can be written this could result in the write queue of the 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 WriteStream
is full, and if so, the ReadStream
is paused, and a drainHandler
is set on the
WriteStream
.
When the WriteStream
has processed half of its backlog, the drainHandler
will be
called, which results in the pump resuming the ReadStream
.
This class can be used to pump from any ReadStream
to any WriteStream
,
e.g. from an HttpServerRequest
to an AsyncFile
,
or from NetSocket
to a WebSocket
.
Please see the documentation for more information.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.io.vertx.core.streams.Pump
Deprecated.int
hashCode()
Deprecated.static Pump
newInstance
(io.vertx.core.streams.Pump arg) Deprecated.int
Deprecated.static <T> Pump
pump
(ReadStream<T> rs, WriteStream<T> ws) Deprecated.static <T> Pump
pump
(ReadStream<T> rs, WriteStream<T> ws, int writeQueueMaxSize) Deprecated.static <T> Pump
pump
(Flow.Publisher<T> rs, WriteStream<T> ws) Deprecated.static <T> Pump
pump
(Flow.Publisher<T> rs, WriteStream<T> ws, int writeQueueMaxSize) Deprecated.setWriteQueueMaxSize
(int maxSize) Deprecated.start()
Deprecated.stop()
Deprecated.toString()
Deprecated.
-
Field Details
-
__TYPE_ARG
Deprecated.
-
-
Constructor Details
-
Pump
public Pump(io.vertx.core.streams.Pump delegate) Deprecated. -
Pump
Deprecated.
-
-
Method Details
-
getDelegate
public io.vertx.core.streams.Pump getDelegate()Deprecated.- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
Deprecated. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
pump
Deprecated.- Parameters:
rs
- the read streamws
- the write stream- Returns:
- the pump
-
pump
Deprecated.- Parameters:
rs
- the read streamws
- the write stream- Returns:
- the pump
-
pump
Deprecated.- Parameters:
rs
- the read streamws
- the write streamwriteQueueMaxSize
- the max size of the write queue- Returns:
- the pump
-
pump
@Deprecated public static <T> Pump pump(Flow.Publisher<T> rs, WriteStream<T> ws, int writeQueueMaxSize) Deprecated.- Parameters:
rs
- the read streamws
- the write streamwriteQueueMaxSize
- the max size of the write queue- Returns:
- the pump
-
setWriteQueueMaxSize
Deprecated.- Parameters:
maxSize
- the max size- Returns:
- a reference to this, so the API can be used fluently
-
start
Deprecated.- Returns:
- a reference to this, so the API can be used fluently
-
stop
Deprecated.- Returns:
- a reference to this, so the API can be used fluently
-
numberPumped
Deprecated.- Returns:
-
newInstance
Deprecated.
-