Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Pump
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Pump(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def numberPumped(): Int

    Return the total number of items pumped by this pump.

  17. def setWriteQueueMaxSize(maxSize: Int): Pump

    Set the write queue max size to maxSize * @param maxSize the max size

    Set the write queue max size to maxSize * @param maxSize the max size

    returns

    a reference to this, so the API can be used fluently

  18. 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

  19. 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

  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped