vertx / io.vertx.reactivex.core.streams / WriteStream / drainHandler

drainHandler

abstract fun drainHandler(handler: Handler<Void>): WriteStream<T>

Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See io.vertx.reactivex.core.streams.Pump for an example of this being used. The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to maxSize / 2.

Parameters

handler - the handler

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