org.vertx.scala.core.streams

Pump

final class Pump extends Self

Pumps data from a org.vertx.scala.core.streams.ReadStream to a org.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 bytes from a org.vertx.scala.core.streams.ReadStream and write them to a org.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 org.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 org.vertx.scala.core.streams.WriteStream is full, and if so, the org.vertx.scala.core.streams.ReadStream is paused, and a drainHandler is set on the org.vertx.scala.core.streams.WriteStream. When the org.vertx.scala.core.streams.WriteStream has processed half of its backlog, the drainHandler will be called, which results in the pump resuming the org.vertx.scala.core.streams.ReadStream.

This class can be used to pump from any org.vertx.scala.core.streams.ReadStream to any org.vertx.scala.core.streams.WriteStream, e.g. from an org.vertx.scala.core.http.HttpServerRequest to an org.vertx.scala.core.file.AsyncFile, or from org.vertx.scala.core.net.NetSocket to a org.vertx.scala.core.http.WebSocket.

Instances of this class are not thread-safe.

Linear Supertypes
Self, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Pump
  2. Self
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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. val asJava: java.core.streams.Pump

  6. def bytesPumped(): Int

    Return the total number of bytes pumped by this pump.

  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def setWriteQueueMaxSize(maxSize: Int): Pump

    Set the write queue max size to maxSize

  18. def start(): Pump

    Start the Pump.

    Start the Pump. The Pump can be started and stopped multiple times.

  19. def stop(): Pump

    Stop the Pump.

    Stop the Pump. The Pump can be started and stopped multiple times.

  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
    @throws( ... )
  25. def wrap[X](doStuff: ⇒ X): Pump.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped