This method is used to easily handle the common request - response pattern in mqtt. There are two topics, one is the topic on which the request is sent and the other one is where the response is received. There is the common option to transform the response, however the response is unzipped (if valid) by default.

Under the hood, it uses the multiTopicPublish flow.

Constructors

Methods

Constructors

Methods

  • Type Parameters

    • T = Buffer

    Parameters

    • options: {
          payload:
              | string
              | object
              | any[]
              | Buffer;
          responseTopic: string;
          topic: string;
          transformer?: ((data: Buffer) => T);
      }
      • payload:
            | string
            | object
            | any[]
            | Buffer
      • responseTopic: string
      • topic: string
      • Optionaltransformer?: ((data: Buffer) => T)
          • (data: Buffer): T
          • Parameters

            • data: Buffer

            Returns T

    Returns Promise<T>

  • Parameters

    • Optionalmilliseconds: number

    Returns void