Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Consume_channel: avoid repeating query if previous query is not yet f…
Browse files Browse the repository at this point in the history
…inished
  • Loading branch information
cdujeu committed Feb 25, 2015
1 parent 2e6cf3f commit 73a1f43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/plugins/core.mq/class.AjxpMqObserver.js
Expand Up @@ -28,6 +28,7 @@ Class.create("AjxpMqObserver", {
clientId:null,
ws: null,
configs: null,
channel_pending: false,

initialize : function(){
"use strict";
Expand Down Expand Up @@ -147,6 +148,9 @@ Class.create("AjxpMqObserver", {
},

consumeChannel : function(){
if(this.channel_pending) {
return;
}
var conn = new Connexion();
conn.setParameters($H({
get_action:'client_consume_channel',
Expand All @@ -155,11 +159,13 @@ Class.create("AjxpMqObserver", {
}));
conn.discrete = true;
conn.onComplete = function(transport){
this.channel_pending = false;
if(transport.responseXML){
ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
ajaxplorer.notify("server_message", transport.responseXML);
}
};
}.bind(this);
this.channel_pending = true;
conn.sendAsync();
}

Expand Down

0 comments on commit 73a1f43

Please sign in to comment.