@lppedd/message-bus - v0.9.1
    Preparing search index...

    Interface UnicastTopic<T, R>

    A specialized topic that allows only a single subscription per message bus hierarchy.

    Once a subscription exists anywhere in the hierarchy (root bus and all its children), attempting to subscribe again for the same topic will throw an error.

    Separate message bus hierarchies can each have their own subscription.

    interface UnicastTopic<T = unknown, R = unknown> {
        broadcastDirection: "children" | "parent";
        displayName: string;
        mode: "unicast";
        (priority?: number, limit?: number): ParameterDecorator;
    }

    Type Parameters

    • T = unknown
    • R = unknown

    Hierarchy (View Summary)

    • Parameters

      • Optionalpriority: number
      • Optionallimit: number

      Returns ParameterDecorator

    Index

    Properties

    broadcastDirection: "children" | "parent"

    The broadcasting direction for a topic.

    A message published to the topic will always be delivered first to handlers registered on the bus where publish() is called.

    Then, if the direction is:

    • children: the message is also propagated to all child buses recursively
    • parent: the message is also propagated to the immediate parent bus

    A topic broadcasts to children by default.

    displayName: string

    A human-readable name for the topic, useful for debugging and logging.

    mode: "unicast"

    Whether the topic allows multiple subscriptions or only a single subscription.

    • multicast: the topic can have multiple subscribers
    • unicast: the topic can have at most one subscriber

    A topic is multicast by default.