joyent/node — Issue #1977: Feature suggestion: Add API for low/high watermark listeners and retrieving current value of pending bytes for writable Streams
Author: thejh
Created: 2011-10-31 15:36:41+00:00
State: open

Hello,
for outgoing streams, I can't see any way to get the current number of queued bytes. I propose to add the following API:

.getPendingBytes()
.on('pendingBytesChange', function(newByteCount){})

And maybe also (although this could be provided via a third-party library):

// called when the number of pending bytes was >=treshold and now is treshold
.onHigh(treshold, function(newByteCount){})