Class RealtimeRequest

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.

Hierarchy

  • RealtimeRequest

Constructors

Properties

Methods

Constructors

Properties

#timeout?: number = ...

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
      • Optional transformer?: ((data: Buffer) => T)
          • (data: Buffer): T
          • Parameters

            • data: Buffer

            Returns T

    Returns Promise<T>

  • Parameters

    • Optional milliseconds: number

    Returns void