Tabnine Logo For Javascript
Connection
Code IndexAdd Tabnine to your IDE (free)

How to use
Connection
in
rhea-promise

Best JavaScript code snippets using rhea-promise.Connection(Showing top 12 results out of 315)

origin: moleculerjs/moleculer

/**
   * Disconnect from an AMQP 1.0 server
   * Close every receiver on the connections and the close the connection
   * @memberof Amqp10Transporter
   */
  disconnect() {
    if (this.connection) {
      return this.broker.Promise.all(this.receivers.map(receiver => receiver.close()))
        .then(() => this.connection.close())
        .then(() => {
          this.connection = null;
          this.connected = false;
          this.session = null;
          this.receivers = [];
        })
        .catch(error => this.logger.error(error));
    }
  }
origin: moleculerjs/moleculer

/**
   * Subscribe to balanced event command
   * For EVENTB command types
   * These queues will be used when the "disableBalancer" set to true
   *
   * @param {String} event
   * @param {String} group
   * @memberof Amqp10Transporter
   */
  subscribeBalancedEvent(event, group) {
    const queue = `${this.prefix}.${PACKET_EVENT}B.${group}.${event}`;
    const receiverOptions = Object.assign(
      {
        source: { address: queue },
        autoaccept: false,
        session: this.session
      },
      this._getQueueOptions(PACKET_EVENT + "LB", true)
    );

    return this.connection.createReceiver(receiverOptions).then(receiver => {
      receiver.on("message", this._consumeCB(PACKET_EVENT, true));

      this.receivers.push(receiver);
    });
  }
origin: moleculerjs/moleculer

};
return this.connection
  .createAwaitableSender(awaitableSenderOptions)
  .then(sender => {
    return sender
origin: moleculerjs/moleculer

};
return this.connection
  .createAwaitableSender(awaitableSenderOptions)
  .then(sender => {
    return sender
origin: moleculerjs/moleculer

  this._getQueueOptions(PACKET_REQUEST, true)
);
return this.connection.createReceiver(receiverOptions).then(receiver => {
  if (this.opts.prefetch !== 0) {
    receiver.addCredit(this.opts.prefetch);
origin: moleculerjs/moleculer

  rhea.Connection.prototype.open = jest.fn(() => Promise.reject());
      expect(transporter.connection).toBeNull();
      expect(transporter.connected).toEqual(false);
      rhea.Connection.prototype.open = jest.fn(() => Promise.resolve(new rhea.Connection()));
    });
});
origin: moleculerjs/moleculer

const connection = container.createConnection(connectionOptions);
connection.on("disconnected", e => {
  this.logger.info("AMQP10 disconnected.");
  this.connected = false;
  if (e) {
    this.logger.error("AMQP10 connection error.", (this.connection && this.connection.error) || "");
    errorCallback && errorCallback(e);
  .open()
  .then(connection => {
    this.connection = connection;
    this.connection.createSession().then(session => {
      this.session = session;
      this.logger.info("AMQP10 is connected");
      this.connection._connection.setMaxListeners(0);
      this.session._session.setMaxListeners(0);
      this.session.setMaxListeners(0);
  })
  .catch(e => {
    this.logger.error("AMQP10 connection error.", (this.connection && this.connection.error) || "");
    this.logger.info("AMQP10 is disconnected.");
    this.connected = false;
origin: moleculerjs/moleculer

};
return this.connection
  .createAwaitableSender(awaitableSenderOptions)
  .then(sender => {
    return sender
origin: moleculerjs/moleculer

});
return this.connection.createReceiver(receiverOptions).then(receiver => {
  if (this.opts.prefetch !== 0) {
    receiver.addCredit(this.opts.prefetch);
  session: this.session
});
return this.connection.createReceiver(receiverOptions).then(receiver => {
  receiver.on("message", context => {
    this._consumeCB(cmd, false)(context);
origin: ErickWendel/poc-activemq-nodejs

async connect() {

    try {
      const data = this.connectionData;
      const connection = new Connection({
        ...data,
        reconnect: false,
      });

      this.connection = await connection.open();
    } catch (error) {
      this.tentatives += 1
      if (this.tentatives > 3) {
        console.log('maximum tentatives excedeed', this.tentatives)
        throw error
      }
      console.log('trying to connect again, waiting a second')
      await QueueHandler.sleep(1000)
      return this.connect()
    }

  }
origin: ErickWendel/poc-activemq-nodejs

this.senders[event] = await this.connection.createAwaitableSender(senderOptions);
origin: ErickWendel/poc-activemq-nodejs

this.receivers[event] = await this.connection.createReceiver(receiverOptions);
rhea-promise(npm)Connection

Most used rhea-promise functions

  • Connection.createAwaitableSender
  • Connection.createReceiver
  • Connection.open
  • AwaitableSender
  • AwaitableSender.close
  • Connection,
  • Connection._connection,
  • Connection.close,
  • Connection.createSession,
  • Connection.error,
  • Connection.on,
  • Connection.prototype,
  • Container.createConnection,
  • Receiver,
  • Receiver.addCredit,
  • Receiver.on,
  • Session,
  • Session._session,
  • Session.setMaxListeners

Popular in JavaScript

  • semver
    The semantic version parser used by npm.
  • crypto
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • http
  • chalk
    Terminal string styling done right
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • commander
    the complete solution for node.js command-line programs
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now