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:
parent
31318b03d7
commit
97d271be2c
@ -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);
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user