vertx-lang-scala-docs_2.12 3.9.1 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 cli
  Definition Classes
    core
-  package datagram
  Definition Classes
    core
-  package dns
  Definition Classes
    core
-  package eventbus
  Definition Classes
    core
-  package file
  Definition Classes
    core
-  package http
  Definition Classes
    core
-  package json
  Definition Classes
    core
-  package metrics
  Definition Classes
    core
-  package net
  Definition Classes
    core
-  package parsetools
  Definition Classes
    core
-  package shareddata
  Definition Classes
    core
-  package streams
  Definition Classes
    core
- Pipe
- Pump
- ReadStream
- StreamBase
- WriteStream

p

io.vertx.scala.core

# streams 

#### package streams

 
Ordering

1. Alphabetic

Visibility

1. Public
2. All

### Type Members

1.  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.

   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.

2.  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.

   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.

3.  trait ReadStream[T] extends StreamBase

   Represents a stream of items that can be read from.

   Represents a stream of items that can be read from.

   Any class that implements this interface can be used by a io.vertx.scala.core.streams.Pump to pump data from it to a io.vertx.scala.core.streams.WriteStream.

   ##### Streaming mode

   The stream is either in flowing or fetch mode.

   Initially the stream is in flowing mode.

   - When the stream is in flowing mode, elements are delivered to the `handler`.
   - When the stream is in fetch mode, only the number of requested elements will be delivered to the `handler`.

   The mode can be changed with the io.vertx.scala.core.streams.ReadStream#pause, io.vertx.scala.core.streams.ReadStream#resume and io.vertx.scala.core.streams.ReadStream#fetch methods:

   - Calling io.vertx.scala.core.streams.ReadStream#resume sets the flowing mode
   - Calling io.vertx.scala.core.streams.ReadStream#pause sets the fetch mode and resets the demand to `0`
   - Calling io.vertx.scala.core.streams.ReadStream#fetch requests a specific amount of elements and adds it to the actual demand
4.  trait StreamBase extends AnyRef

   Base interface for a stream.

5.  trait WriteStream[T] extends StreamBase

   Represents a stream of data that can be written to.

   Represents a stream of data that can be written to.

   Any class that implements this interface can be used by a io.vertx.scala.core.streams.Pipe to pipe data from a `ReadStream` to it.

### Value Members

1.  object Pipe
2.  object Pump
3.  object ReadStream
4.  object StreamBase
5.  object WriteStream

### Ungrouped