rdfa-streaming-parser.js icon indicating copy to clipboard operation
rdfa-streaming-parser.js copied to clipboard

Ensure backpressure is maintained in streams

Open rubensworks opened this issue 4 years ago • 0 comments

There may be some places where we are not adhering to Node's backpressure conventions with regards to streams.

Concretely, we seem to be creating new streams (such as Readable, PassThrough and Transform), and push-ing into them (via a 'data' handler on another stream). Node handles backpressuring via the return value of push, which we are ignoring in this manner.

A better solution would be to simply pipe instead of calling push on each data element.

Related to https://github.com/rubensworks/rdf-parse.js/commit/269c757935c54b388e1bde076dc29c2afc2e8e7b

rubensworks avatar Nov 12 '20 14:11 rubensworks