class Pump extends AnyRef
Pumps data from a io.vertx.scala.core.streams.ReadStream to a io.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 items from a io.vertx.scala.core.streams.ReadStream and write them to a io.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 io.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 io.vertx.scala.core.streams.WriteStream is full, and if so, the io.vertx.scala.core.streams.ReadStream is paused, and a drainHandler
is set on the
io.vertx.scala.core.streams.WriteStream.
When the io.vertx.scala.core.streams.WriteStream has processed half of its backlog, the drainHandler
will be
called, which results in the pump resuming the io.vertx.scala.core.streams.ReadStream.
This class can be used to pump from any io.vertx.scala.core.streams.ReadStream to any io.vertx.scala.core.streams.WriteStream, e.g. from an io.vertx.scala.core.http.HttpServerRequest to an io.vertx.scala.core.file.AsyncFile, or from io.vertx.scala.core.net.NetSocket to a io.vertx.scala.core.http.WebSocket.
Please see the documentation for more information.
- Alphabetic
- By Inheritance
- Pump
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Pump(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
numberPumped(): Int
Return the total number of items pumped by this pump.
-
def
setWriteQueueMaxSize(maxSize: Int): Pump
Set the write queue max size to
maxSize
* @param maxSize the max sizeSet the write queue max size to
maxSize
* @param maxSize the max size- returns
a reference to this, so the API can be used fluently
-
def
start(): Pump
Start the Pump.
Start the Pump. The Pump can be started and stopped multiple times. * @return a reference to this, so the API can be used fluently
-
def
stop(): Pump
Stop the Pump.
Stop the Pump. The Pump can be started and stopped multiple times. * @return a reference to this, so the API can be used fluently
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )