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

Program Not Terminating After Event Handling and Subscription Closure #339

Open
richard16611 opened this issue Dec 30, 2023 · 0 comments
Open

Comments

@richard16611
Copy link

The following code successfully retrieves events and seems to close the subscription, but the program doesn't terminate.

const events = await pool.querySync(relays, { authors: [pk]})
console.log(events)

Same goes to:

await pool.subscribeManyEose(
  relays,
  [
    {
      authors: [pk],
    },
  ],
  {
    onevent(event) {
      console.log("got event", event)
    },
    onclose() {
      console.log("subscription closed")
    },
  }
)

The events are received and the 'subscription closed' message is logged, but the program isn't terminating. Maybe this is the intended and expected behavior, I just want to make sure.

I'm running in Bun runtime.

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