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

MQTT connection holds nodejs event loop open #44

Open
jottinger opened this issue Feb 17, 2022 · 1 comment
Open

MQTT connection holds nodejs event loop open #44

jottinger opened this issue Feb 17, 2022 · 1 comment

Comments

@jottinger
Copy link

I would like to set a hook for shutdown, something like this:

process.on('exit', () => { mqttConnection.end(true).then(()=>{}).catch(()=>{});

This... never works. process.exit(1) does, the process isn't hung, it just never gets the idea that the node event loop is empty. Is there a way to make it so the event loop can empty when an MQTT connection is available? It may already be possible, I just don't know how.

@RangerMauve
Copy link
Contributor

Would you mind submitting a minimal reproducible test case for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants