Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream.push() after EOF #42

Open
xloem opened this issue Mar 31, 2020 · 0 comments
Open

stream.push() after EOF #42

xloem opened this issue Mar 31, 2020 · 0 comments

Comments

@xloem
Copy link

xloem commented Mar 31, 2020

I'm having some errors thrown sometimes when a stream is stopped prematurely.

const bluestream = require('bluestream')
const pump = require('pump')

test()
async function test()
{
  let count = 0
  let pipeline = pump(
    bluestream.read(() => {
      console.log(`Sending count: ${++count}`)
      return count
    }),
    bluestream.tap(console.log),
  )
  let data = await bluestream.readAsync(pipeline, 3)
  console.log(`Data: ${data}`)
  pipeline.destroy()
  await bluestream.wait(pipeline)
}
(node:13071) UnhandledPromiseRejectionWarning: Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:240:30)
    at TapStream.Readable.push (_stream_readable.js:208:10)
    at TapStream.Transform.push (_stream_transform.js:147:32)
    at Promise.resolve.then.value (/home/karl/src/care/projects/bitfiles/node_modules/bluestream/dist/transform.js:92:47)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant