ByteLengthQueuingStrategy()
The ByteLengthQueuingStrategy()
constructor creates and returns a ByteLengthQueuingStrategy
object
instance.
Syntax
new ByteLengthQueuingStrategy(highWaterMark)
Parameters
An object with the following property:
highWaterMark
: The total number of bytes that can be contained in the internal queue before backpressure is applied.
Unlike
CountQueuingStrategy()
where thehighWaterMark
parameter specifies a simple count of the number of chunks, withByteLengthQueuingStrategy()
, thehighWaterMark
parameter specifies a number of bytes — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied.
Return value
An instance of the ByteLengthQueuingStrategy
object.