A ICommunicationBridge is used to establish different connections (a bridge can establish several connections with different layers).

The ICommunicationBridge is the core interface with which all Nope core elements interact. Its main task is to add and remove multiple layers (like 'mqtt' or 'io-sockets'; see ICommunicationInterface)

To the outside, the bridge behaves like a ICommunicationInterface. I.e. the methods on and emit are also implemented. However, the bridge ensures that each of the ICommunicationInterface added, are able to receive and send the messages. Furthermore the status connected indicates whether all layers are connected or not.

If different layers are only optional, e.g. all connections are covered by io-sockets, but all messages are to be mirrored to MQTT because they are to be picked up there, then this can be taken into account in the add method. These connections are then not taken into account in the connected status.

Export

ICommunicationBridge

Hierarchy

  • Bridge

Implements

Constructors

Properties

connected: INopeObservable<boolean, boolean, boolean, IEventAdditionalData>

Flag, indication, whether the Layer is connected or not.

considerConnection: boolean = true
id: string

ID of the Layer.

Author

M.Karkowski

Memberof

ICommunicationInterface

ownDispatcherId: string

Accessors

Methods

  • Helper to detail the listeners of the "event", "rpc", "data" or "responses"

    Parameters

    • type: "event" | "rpc" | "data" | "response"

      valid type to detail the name

    • listeners: string[]

      the currently used listeners.

    Returns void

  • Readable status of the Connection.

    Returns

    The Statsus

    Memberof

    ICommunicationBridge

    Returns {
        connected: boolean;
        layers: {
            considerConnection: boolean;
            forwardData: boolean;
            id: string;
            receivesOwnMessages: boolean;
        }[];
    }

    • connected: boolean
    • layers: {
          considerConnection: boolean;
          forwardData: boolean;
          id: string;
          receivesOwnMessages: boolean;
      }[]

Generated using TypeDoc