Skip to content

MQTT connection holds nodejs event loop open #44

@jottinger

Description

@jottinger

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions