Setu-TS
    Preparing search index...

    Interface IPubSubTransport

    Domain port for GCP Pub/Sub operations. The broker depends on this, not the SDK directly.

    interface IPubSubTransport {
        close(): Promise<void>;
        createSubscription(topic: string, subscription: string): Promise<void>;
        deleteSubscription(subscription: string): Promise<void>;
        isHealthy?(): Promise<boolean | undefined>;
        open(
            topic: string,
            subscription: string,
            onMessage: (
                msg: {
                    ack: () => void;
                    attributes?: Readonly<Record<string, string>>;
                    messageId?: string;
                    nack: () => void;
                    payload: string;
                    timestamp?: Date;
                },
            ) => void,
        ): Promise<IPubSubSubscription>;
        publish(
            topic: string,
            bytes: Uint8Array,
            attributes?: Readonly<Record<string, string>>,
            orderingKey?: string,
        ): Promise<void>;
    }
    Index
    • Reports whether the Pub/Sub backend is reachable (optional, M70c).

      The real adapter calls getTopics (pageSize 1, no pagination, 1500 ms, no retries): resolved → true, gRPC 14 → false, gRPC 4 → undefined, other numeric codes (including permission/auth failures) → true, no numeric code → false. A transport without a probe reports unknown. The SDK owns streaming-pull reconnection, so the broker issues no reconnect loop of its own.

      Returns Promise<boolean | undefined>

    • Open a subscription on a topic. Creates the subscription when absent.

      Parameters

      • topic: string
      • subscription: string
      • onMessage: (
            msg: {
                ack: () => void;
                attributes?: Readonly<Record<string, string>>;
                messageId?: string;
                nack: () => void;
                payload: string;
                timestamp?: Date;
            },
        ) => void

        Called per delivered message

      Returns Promise<IPubSubSubscription>

    • Publish bytes to a topic.

      Parameters

      • topic: string
      • bytes: Uint8Array
      • Optionalattributes: Readonly<Record<string, string>>
      • OptionalorderingKey: string

        Native Pub/Sub ordering key (M106 §3.3); omitted means unordered

      Returns Promise<void>