Open
Description
We've experienced some odd issues that are probably caused by race conditions. I think it boils down to the stream going into flowing mode immediately
Afaik, the stream should only go into flowing mode when:
- We attach an on-data listener
- We pipe it to another writable stream
- We explicitly call
resume()
I would expect the below snippet to terminate fast and essentially be a no-op. In reality it isn't, and depending on the size of test.jsonld
it will take a while for it to finish.
const fs = require("fs");
const { JsonLdParser } = require("./");
fs.createReadStream("./test.jsonld")
.pipe(
new JsonLdParser({
baseIRI: "http://base"
})
)
//Not registering an on-data listener, so not expecting this stream to start flowing
//.on('data', () => {})
Would you agree with my observation with the stream going into flowing mode too quickly?