Skip to content

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

@jedwards1211

Description

@jedwards1211

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')
})()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions