How to use the rhea.removeListener function in rhea

To help you get started, we’ve selected a few rhea examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / qpid-dispatch / console / react / src / amqp / connection.js View on Github external
var connection_open = function (context) {
          clearTimeout(timer);
          // prevent future disconnects from calling reject
          rhea.removeListener("disconnected", disconnected);
          // we were just checking. we don't really want a connection
          if (options.test) {
            context.connection.close();
            this.connection = null;
          } else this.on_connection_open();
          var res = { context: context };
          if (callback) callback(res);
          resolve(res);
        }.bind(this);
        // register an event handler for when the connection opens
github apache / qpid-dispatch / console / react / src / amqp / connection.js View on Github external
var disconnected = function () {
          clearTimeout(timer);
          rhea.removeListener("disconnected", disconnected);
          rhea.removeListener("connection_open", connection_open);
          this.connection = null;
          var rej = "failed to connect";
          if (callback) callback({ error: rej });
          reject(Error(rej));
        }.bind(this);
        var timer = setTimeout(disconnected, timeout);
github apache / qpid-dispatch / console / stand-alone / plugin / js / amqp / connection.js View on Github external
var disconnected = (function () {
        clearTimeout(timer);
        rhea.removeListener('disconnected', disconnected);
        rhea.removeListener('connection_open', connection_open);
        this.connection = null;
        var rej = 'failed to connect';
        if (callback)
          callback({ error: rej });
        reject(Error(rej));
      }).bind(this);
      var timer = setTimeout(disconnected, timeout);
github apache / qpid-dispatch / console / stand-alone / plugin / js / amqp / connection.js View on Github external
var disconnected = (function () {
        clearTimeout(timer);
        rhea.removeListener('disconnected', disconnected);
        rhea.removeListener('connection_open', connection_open);
        this.connection = null;
        var rej = 'failed to connect';
        if (callback)
          callback({ error: rej });
        reject(Error(rej));
      }).bind(this);
      var timer = setTimeout(disconnected, timeout);