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

Reconnection is not supported #405

Open
743v45 opened this issue Apr 26, 2023 · 0 comments
Open

Reconnection is not supported #405

743v45 opened this issue Apr 26, 2023 · 0 comments

Comments

@743v45
Copy link
Contributor

743v45 commented Apr 26, 2023

const nsq = require('./lib/nsq')

const reader = new nsq.Reader('test', 'test', {
  nsqdTCPAddresses: [
    '10.0.6.88:41501',
  ],
})

reader.on('message', msg => {
  console.log('Received message [%s]: %s', msg.id, msg.body.toString())
  msg.finish()
})

reader.connect()

setTimeout(() => {
  reader.close();
}, 1000);

setTimeout(() => {
  reader.connect();
}, 2000);

When reader.close() is executed, isClosed = true is irreversible.

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