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

Injecting the mqtt "client" into more than 10 "<mqtt-connection>"s results in an EventEmitter error message #12

Open
sandro-k opened this issue Oct 1, 2015 · 1 comment
Labels

Comments

@sandro-k
Copy link
Contributor

sandro-k commented Oct 1, 2015

When creating one <mqtt-connection> element and binding to its client property via <mqtt-connection client='{{client}}'> and then injecting it into another mqtt-connection via <mqtt-connection client='[[client]]'> results in the following error when injected into more than 10 different connection:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use 

This is caused by https://github.com/mqttjs/mqtt-elements/blob/master/mqtt-connection.html#L311 as the element is adding itself as a listener to the client

  client
            .on("close", this._handelClose.bind(this))
            .on("connect", this._handelConnected.bind(this))
            .on("error", this._handelError.bind(this))
            .on("message", this._handelMessage.bind(this))
            .on("offline", this._handelOffline.bind(this))
            .on("reconnect", this._handelReconnect.bind(this));

either the property client.setMaxListeners could be exposed via the <mqtt-connection> or increase client.maxListeners each time mqtt-connection._clientChanged is called.

@sandro-k sandro-k added the bug label Oct 1, 2015
@sandro-k
Copy link
Contributor Author

sandro-k commented Oct 1, 2015

The current documentation of the <mqtt-connection> element is online http://mqttjs.github.io/mqtt-elements/bower_components/mqtt-elements/. To switch to the <mqtt-connection> element select it at the top left dropdown.

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

No branches or pull requests

1 participant