Class: DrainSupport

vertx/streams~ DrainSupport

new DrainSupport(delegate)

Provides methods for querying and draining data streams. This is used internally and exposed through module:vertx/streams~WriteStream and other mixins and is not typically used directly.
Parameters:
Name Type Description
delegate external:org.vertx.java.core.streams.WriteStream The Java delegate
Source:

Methods

drainHandler(handler)

Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue has been reduced to maxSize/2. See module:vertx/pump~Pump for an example of this being used.
Parameters:
Name Type Description
handler Handler the handler to call when the stream has been drained
Source:

exceptionHandler(handler)

Set an exception handler on the stream
Parameters:
Name Type Description
handler Handler the handler to call when an exception occurs
Source:

writeQueueFull()

This will return true if there are more bytes in the write queue than the value set using writeQueueMaxSize
Source:

writeQueueMaxSize(size)

Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize bytes in the write queue. This is used as an indicator by classes such as Pump to provide flow control.
Parameters:
Name Type Description
size number the size of the write queue
Source: