1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Deprecate old mqtt client and connection pool modules

This commit is contained in:
Nick O'Leary 2016-03-16 11:15:30 +00:00
parent db686388b9
commit b9f03e7d80
2 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,9 @@
var util = require("util"); var util = require("util");
var mqtt = require("mqtt"); var mqtt = require("mqtt");
var events = require("events"); var events = require("events");
util.log("[warn] nodes/core/io/lib/mqtt.js is deprecated and will be removed in a future release of Node-RED. Please report this usage to the Node-RED mailing list.");
//var inspect = require("util").inspect; //var inspect = require("util").inspect;
//var Client = module.exports.Client = function( //var Client = module.exports.Client = function(

View File

@ -17,6 +17,8 @@ var util = require("util");
var mqtt = require("./mqtt"); var mqtt = require("./mqtt");
var settings = require(process.env.NODE_RED_HOME+"/red/red").settings; var settings = require(process.env.NODE_RED_HOME+"/red/red").settings;
util.log("[warn] nodes/core/io/lib/mqttConnectionPool.js is deprecated and will be removed in a future release of Node-RED. Please report this usage to the Node-RED mailing list.");
var connections = {}; var connections = {};
function matchTopic(ts,t) { function matchTopic(ts,t) {
@ -60,7 +62,7 @@ module.exports = {
subscribe: function(topic,qos,callback,ref) { subscribe: function(topic,qos,callback,ref) {
ref = ref||0; ref = ref||0;
subscriptions[topic] = subscriptions[topic]||{}; subscriptions[topic] = subscriptions[topic]||{};
var sub = { var sub = {
topic:topic, topic:topic,
qos:qos, qos:qos,
@ -104,7 +106,7 @@ module.exports = {
} }
}, },
disconnect: function(ref) { disconnect: function(ref) {
this._instances -= 1; this._instances -= 1;
if (this._instances == 0) { if (this._instances == 0) {
client.disconnect(); client.disconnect();