Skip to main content
Version: 3.21.2

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 the highWaterMark parameter specifies a simple count of the number of chunks, with ByteLengthQueuingStrategy(), the highWaterMark 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.