Class DataPubSubSystem

Default implementation of IDataPubSubSystem

Extends the PubSubSystem by adding the following properties and methods:

  • pushData to push data into the system.
  • pullData to pull data from the system. Will allways return the current data or the default value if no data is present at the given path.
  • patternbasedPullData to pull data with a given pattern. See the example for details.
  • patternBasedPush to push data with a given pattern into the system.
  • If you want to acces the root data please check the property data which will contain the entire data root that has been created.

Hierarchy

Implements

Constructors

Properties

_options: IPubSubOptions = ...

An observable which holds the incremental data change. this will be triggered, if the an emitter (publisher) changes its data. Contains only the last emitted data and the topic

// Describe the required Test:
let pubSubSystem = new PubSubSystemBase({
generateEmitterType: function () {
return new NopeEventEmitter() as INopeEventEmitter;
},
});


// Create a Publisher for the system:
let publisher: INopeEventEmitter = new NopeEventEmitter();

pubSubSystem.register(publisher, {
mode: "publish",
schema: {},
topic: "this/is/a/test",
});


pubSubSystem.onIncrementalDataChange.subscribe(console.log);
publisher.emit("Hello World!"); // Logs the following => {path: "this/is/a/test", data: "Hello World!"}

Author

M.Karkowski

Memberof

IPubSubSystem

List containing all publishers.

Author

M.Karkowski

Memberof

IPubSubSystem

List, containing all subscribers.

Author

M.Karkowski

Memberof

IPubSubSystem

Accessors

  • get data(): unknown
  • A Getter to return a COPY of the item. Outside of the system, you'll never receive the original object. It is allways a clone.

    Author

    M.Karkowski

    Memberof

    PubSubSystemBase

    Returns unknown

  • get emitters(): {
        publishers: {
            name: string;
            schema: INopeDescriptor;
        }[];
        subscribers: {
            name: string;
            schema: INopeDescriptor;
        }[];
    }
  • List all known Emitters in the System.

    Returns {
        publishers: {
            name: string;
            schema: INopeDescriptor;
        }[];
        subscribers: {
            name: string;
            schema: INopeDescriptor;
        }[];
    }

Methods

Generated using TypeDoc