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

make sure stomp client calls done on close.

This commit is contained in:
dceejay 2015-04-17 21:06:27 +01:00
parent 31318b03d7
commit 97d271be2c
2 changed files with 9 additions and 6 deletions

View File

@ -90,12 +90,11 @@ module.exports = function(RED) {
node.on("close", function(done) { node.on("close", function(done) {
closing = true; closing = true;
if (node.client) { if (node.client) {
node.client.on("disconnect", function() { node.client.on("disconnect", function() { done(); });
done();
});
//node.client.unsubscribe(node.topic); //node.client.unsubscribe(node.topic);
node.client.disconnect(); node.client.disconnect();
} else { done(); } }
else { done(); }
}); });
} }
RED.nodes.registerType("stomp in",StompInNode); RED.nodes.registerType("stomp in",StompInNode);
@ -143,7 +142,11 @@ module.exports = function(RED) {
node.on("close", function(done) { node.on("close", function(done) {
closing = true; closing = true;
if (client) { client.disconnect(); } if (node.client) {
node.client.on("disconnect", function() { done(); });
node.client.disconnect();
}
else { done(); }
}); });
} }
RED.nodes.registerType("stomp out",StompOutNode); RED.nodes.registerType("stomp out",StompOutNode);

View File

@ -1,6 +1,6 @@
{ {
"name" : "node-red-node-stomp", "name" : "node-red-node-stomp",
"version" : "0.0.3", "version" : "0.0.4",
"description" : "A Node-RED node to publish and subscribe to/from a Stomp server", "description" : "A Node-RED node to publish and subscribe to/from a Stomp server",
"dependencies" : { "dependencies" : {
"stomp-client" : "0.6.2" "stomp-client" : "0.6.2"