References Deprecated
Pump is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
io.vertx.core.streams.ReadStream to a io.vertx.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 io. and write them to a io.. If data
can be read faster than it can be written this could result in the write queue of the io. 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. is full, and if so, the io. is paused, and a drainHandler is set on the
io.. When the io. has processed half of its backlog, the drainHandler will be
called, which results in the pump resuming the io..
This class can be used to pump from any io. to any io.,
e.g. from an io. to an io.,
or from io. to a io..
Instances of this class are not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private final Handler | |
| private final Handler | |
| private int | |
| private final ReadStream | |
| private final WriteStream |
| Access | Constructor and Description |
|---|---|
| public | PumpImpl(ReadStream<T> rs, WriteStream<T> ws, int maxWriteQueueSize)
Create a new |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | |
| public synchronized int | numberPumped()
Implements io. Return the total number of elements pumped by this pump. |
| public PumpImpl | setWriteQueueMaxSize(int
the max size maxSize)Implements io.
References Deprecated
PumpImpl is deprecated or references (maybe indirectly) at least one deprecated element.
Set the write queue max size to |
| public PumpImpl | start()
Implements io.
References Deprecated
PumpImpl is deprecated or references (maybe indirectly) at least one deprecated element.
Start the Pump. |
| public PumpImpl | stop()
Implements io.
References Deprecated
PumpImpl is deprecated or references (maybe indirectly) at least one deprecated element.
Stop the Pump. |
| dataHandler | back to summary |
|---|---|
| private final Handler<T> dataHandler | |
| drainHandler | back to summary |
|---|---|
| private final Handler<Void> drainHandler | |
| pumped | back to summary |
|---|---|
| private int pumped | |
| readStream | back to summary |
|---|---|
| private final ReadStream<T> readStream | |
| writeStream | back to summary |
|---|---|
| private final WriteStream<T> writeStream | |
| PumpImpl | back to summary |
|---|---|
| public PumpImpl(ReadStream<T> rs, WriteStream<T> ws, int maxWriteQueueSize) Create a new | |
| PumpImpl | back to summary |
|---|---|
| public PumpImpl(ReadStream<T> rs, WriteStream<T> ws) | |
| incPumped | back to summary |
|---|---|
| private synchronized void incPumped() | |
| numberPumped | back to summary |
|---|---|
| public synchronized int numberPumped() Implements io. Return the total number of elements pumped by this pump.
| |
| setWriteQueueMaxSize | back to summary |
|---|---|
| public PumpImpl Implements io. References Deprecated
See corresponding docs for further information. Set the write queue max size to
| |
| start | back to summary |
|---|---|
| public PumpImpl Implements io. References Deprecated
See corresponding docs for further information. Start the Pump. The Pump can be started and stopped multiple times.
| |
| stop | back to summary |
|---|---|
| public PumpImpl Implements io. References Deprecated
See corresponding docs for further information. Stop the Pump. The Pump can be started and stopped multiple times.
| |