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

Event loop can die if stop() not called #75

Open
jedwards1211 opened this issue Sep 29, 2022 · 1 comment
Open

Event loop can die if stop() not called #75

jedwards1211 opened this issue Sep 29, 2022 · 1 comment

Comments

@jedwards1211
Copy link
Contributor

Opening a separate issue from #49 for the sake of people googling why their process is just dying on them.

It seems a bit too easy to accidentally cause the event loop to die:

const { Repeater } = require('@repeaterjs/repeater')

const test = new Repeater((push, stop) => {
  push(1)
  // stop()
})

;(async () => {
  for await (const value of test) {
    console.log(value)
  }
  // event loop dies before this point unless you uncomment stop() above
  console.log('done')
})()
@andrewmclagan
Copy link

yep encountered this behaviour after many hours ended up here.

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

2 participants