Module: vertx/streams

vertx/streams

There are several objects in vert.x that allow data to be read from and written to in the form of Buffers. In Vert.x, calls to write data return immediately and writes are internally queued.

It's not hard to see that if you write to an object faster than it can actually write the data to its underlying resource then the write queue could grow without bound - eventually resulting in exhausting available memory.

To solve this problem a simple flow control capability is provided by some objects in the vert.x API.

Any flow control aware object that can be written to is said to implement module:vertx/streams~WriteStream, and any flow control object that can be read from is said to implement module:vertx/streams~ReadStream.

The object types defined in this module are typically not instantiated by directly, but are provided to callback functions in modules such as module:vertx/file_system, module:vertx/net and module:vertx/http.

Source:

Classes

DrainSupport
ReadStream
ReadSupport
WriteStream