waitForPublications (timeout) {
    return new Promise((resolve, reject) => {
      if (timeout === undefined) {
        timeout = -1
      } else if (!_isNumber(timeout)) {
        throw new TypeError('timeout must be a number')
      }
      if (this.waitSetBusy) {
        throw new Error('Can not concurrently wait on the same Input')
      } else {
        this.waitSetBusy = true
        const currentChangeCount = ref.alloc('int')
        connectorBinding.api.RTI_Connector_wait_for_matched_publication.async(
          this.native,
          timeout,
          currentChangeCount,
          (err, res) => {
            this.waitSetBusy = false
            if (err) {
              return reject(err)
            } else if (res === _ReturnCodes.ok) {
              return resolve(currentChangeCount.deref())
            } else if (res === _ReturnCodes.timeout) {
              return reject(new TimeoutError('Timeout error'))
            } else {
              return reject(new DDSError('DDS error'))
            }
          }
        )
      }
    })
  }
/**
   * Waits for this Input to match or unmatch a compatible DDS Subscription.
   *
   * .. note::
   *   This operation is asynchronous.
   *
   * This method waits for the specified timeout (or if no timeout is 
   * specified, it waits forever), for a match (or unmatch) to occur.
   * @param {number} [timeout] The maximum time to wait, in milliseconds. 
   *   By default, infinite.
   * @throws {TimeoutError} :class:`TimeoutError` will be thrown if the 
   *   timeout expires before any publications are matched.
   * @returns {Promise} Promise object resolving with the change in the 
   *   current number of matched outputs. If this is a positive number, 
   *   the input has matched with new publishers. If it is negative, the 
   *   input has unmatched from an output. It is possible for multiple 
   *   matches and/or unmatches to be returned (e.g., 0 could be returned, 
   *   indicating that the input matched the same number of outputs as it 
   *   unmatched).
   */
Waits for this Input to match or unmatch a compatible DDS Subscription.
note::
This operation is asynchronous.

This method waits for the specified timeout (or if no timeout is
specified, it waits forever), for a match (or unmatch) to occur.
@param {number} [timeout] The maximum time to wait, in milliseconds.
By default, infinite.
@throws {TimeoutError} :class:`TimeoutError` will be thrown if the
timeout expires before any publications are matched.
@returns {Promise} Promise object resolving with the change in the
current number of matched outputs. If this is a positive number,
the input has matched with new publishers. If it is negative, the
input has unmatched from an output. It is possible for multiple
matches and/or unmatches to be returned .
Waits for this Input to match or unmatch a compatible DDS Subscription . note :: This operation is asynchronous . This method waits for the specified timeout ( or if no timeout is specified it waits forever ) for a match ( or unmatch ) to occur . @param { number } [ timeout ] The maximum time to wait in milliseconds . By default infinite . @throws { TimeoutError } : class : ` TimeoutError ` will be thrown if the timeout expires before any publications are matched . @returns { Promise } Promise object resolving with the change in the current number of matched outputs . If this is a positive number the input has matched with new publishers . If it is negative the input has unmatched from an output . It is possible for multiple matches and / or unmatches to be returned .
waitForPublications (timeout) {
    return new Promise((resolve, reject) => {
      if (timeout === undefined) {
        timeout = -1
      } else if (!_isNumber(timeout)) {
        throw new TypeError('timeout must be a number')
      }
      if (this.waitSetBusy) {
        throw new Error('Can not concurrently wait on the same Input')
      } else {
        this.waitSetBusy = true
        const currentChangeCount = ref.alloc('int')
        connectorBinding.api.RTI_Connector_wait_for_matched_publication.async(
          this.native,
          timeout,
          currentChangeCount,
          (err, res) => {
            this.waitSetBusy = false
            if (err) {
              return reject(err)
            } else if (res === _ReturnCodes.ok) {
              return resolve(currentChangeCount.deref())
            } else if (res === _ReturnCodes.timeout) {
              return reject(new TimeoutError('Timeout error'))
            } else {
              return reject(new DDSError('DDS error'))
            }
          }
        )
      }
    })
  }
waitForPublications ( timeout ) { return new Promise ( ( resolve , reject ) => { if ( timeout === undefined ) { timeout = - 1 } else if ( ! _isNumber ( timeout ) ) { throw new TypeError ( 'timeout must be a number' ) } if ( this . waitSetBusy ) { throw new Error ( 'Can not concurrently wait on the same Input' ) } else { this . waitSetBusy = true const currentChangeCount = ref . alloc ( 'int' ) connectorBinding . api . RTI_Connector_wait_for_matched_publication . async ( this . native , timeout , currentChangeCount , ( err , res ) => { this . waitSetBusy = false if ( err ) { return reject ( err ) } else if ( res === _ReturnCodes . ok ) { return resolve ( currentChangeCount . deref ( ) ) } else if ( res === _ReturnCodes . timeout ) { return reject ( new TimeoutError ( 'Timeout error' ) ) } else { return reject ( new DDSError ( 'DDS error' ) ) } } ) } } ) }
Waits for this Input to match or unmatch a compatible DDS Subscription.
Waits for this Input to match or unmatch a compatible DDS Subscription .