vertx-lang-scala-docs_2.12 3.8.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package streams
  Definition Classes
    core
- Pipe
- Pump
- ReadStream
- StreamBase
- WriteStream

c

io.vertx.scala.core.streams

# Pipe 

###
Companion object Pipe

#### class Pipe[T] extends AnyRef

Pipe 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 pipe 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. Pipe
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new Pipe(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])

### 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.  def close(): Unit

   Close the pipe.

   Close the pipe.

   The streams handlers will be unset and the read stream resumed unless it is already ended.

8.  def endOnComplete(end: Boolean): Pipe[T]

   Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` completes, `false` otherwise.

   Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` completes, `false` otherwise.

   Calling this overwrites io.vertx.scala.core.streams.Pipe#endOnFailure and io.vertx.scala.core.streams.Pipe#endOnSuccess. * @param end `true` to end the stream on a source `ReadStream` completion

   returns

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

9.  def endOnFailure(end: Boolean): Pipe[T]

   Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` fails, `false` otherwise.

   Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` fails, `false` otherwise. * @param end `true` to end the stream on a source `ReadStream` failure

   returns

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

10.  def endOnSuccess(end: Boolean): Pipe[T]

    Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` succeeds, `false` otherwise.

    Set to `true` to call io.vertx.scala.core.streams.WriteStream#end when the source `ReadStream` succeeds, `false` otherwise. * @param end `true` to end the stream on a source `ReadStream` success

    returns

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

11.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
12.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
13.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
14.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
15.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
16.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
17.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
18.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
19.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
20.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
21.  def to(dst: WriteStream[T], completionHandler: Handler[AsyncResult[Unit]]): Unit

    Start to pipe the elements to the destination `WriteStream`.

    Start to pipe the elements to the destination `WriteStream`.

    When the operation fails with a write error, the source stream is resumed. * @param dst the destination write stream

    completionHandler

      the handler called when the pipe operation completes

22.  def to(dst: WriteStream[T]): Unit

    Like io.vertx.scala.core.streams.Pipe#to but without a completion handler

23.  def toFuture(dst: WriteStream[T]): scala.concurrent.Future[Unit]

    Like to but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

24.  def toString(): String
    Definition Classes
      AnyRef → Any
25.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
26.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
27.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped