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~Pumpfor an example of this being used.Parameters:
Name Type Description handlerHandler the handler to call when the stream has been drained - Source:
-
exceptionHandler(handler)
-
Set an exception handler on the stream
Parameters:
Name Type Description handlerHandler the handler to call when an exception occurs - Source:
-
writeQueueFull()
-
This will return
trueif there are more bytes in the write queue than the value set usingwriteQueueMaxSize- 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 thanmaxSizebytes in the write queue. This is used as an indicator by classes such asPumpto provide flow control.Parameters:
Name Type Description sizenumber the size of the write queue - Source: