The pub/sub topic interface.

interface IPubSubTopic<T> {
    subscribe: SubscribeFunction<T>;
    close(): void;
    getName(): string;
    getOwnerId(): string;
    publish(content, nodeIds?): void;
    unsubscribe(contentType): void;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

subscribe: SubscribeFunction<T>

Subscribe to the topic.

Type Param: U

Any of the content types defined in ISubscriptions.

Param: contentType

One of the content type defined in ISubscriptions.

Param: callback

The callback when the content is received. callbacks' payload are defined in ISubscriptions.

Methods

  • Close the topic.

    Returns void

  • Publish content to the topic.

    Parameters

    • content: File | T

      The content to publish. Content needs to be a valid JSON.stringify argument.

    • Optional nodeIds: string[]

      The node IDs to publish to.

    Returns void

  • Unsubscribe from the topic.

    Parameters

    Returns void

Generated using TypeDoc