Interface INopeDispatcher

NoPE - Dispatcher

The NoPE-Dispatcher is designed as Layer between the different Modules / Dispatchers. They allow distributed computing or just a simple Service oriented Architecture (SOA). A dispatcher is used to link the modules, share data and events and provide a remote procedure call (rpc) interface.

Building Blocks of a Dispatcher:

element description
connectivityManager establishes a connection to other dispatchers and manages the status of the remotely connected dispatchers. It checks their health and removes dead dispatchers.
eventDistributor shares events accross the network (or internally). You can use this element to listen for specific events. The subscription to those events allows mqtt-patterns. Additionaly, you are allowed to emit event on specific topics, or pattern based topics
dataDistributor shares data accross the network (or internally). In comperisson to events, data is persistent and is available all the time. You can use this sub-module to listen for specific data-changes (install data-hooks), pull specific data or push data. You can pull / push data using a mqtt-pattern based path.
rpcManager Used to perform remote procedure calls (see here). The manager keeps track of the available services. You must use the sub-module to register/unregister (new) services.
instanceManager Used to create/dispose (remote) instances. The manager keeps track of the available instances in the network, allows to create wrappers for those instances. You must use the sub-module to register/unregister (new) instances. To allow the system to provide a service for creating instances of as specific type, you can provide a generator and provide it as service.

Export

INopeDispatcher

Hierarchy

Properties

communicator: ICommunicationBridge

The Communicator which is used

Author

M.Karkowski

Memberof

INopeCore

connectivityManager: INopeConnectivityManager

System to manage the connectitivy of other dispatchers.

Author

M.Karkowski

Memberof

INopeCore

Pub-Sub-System to share the properties and their sub properties acorss the entire network.

Author

M.Karkowski

Memberof

INopeCore

disposing: boolean

A Flag, that indicates, that the core is disposing.

Author

M.Karkowski

Memberof

INopeCore

eventDistributor: IPubSubSystem<ITopicSetContentOptions, INopeEventEmitter<unknown, unknown, unknown, ITopicSetContentOptions>, INopeTopic<any, any, any>>

Pub-Sub-System to share the events across the system. Events wont retain after they have been fired. You can just subscribe to events.

Author

M.Karkowski

Memberof

INopeCore

id: string

ID of the Dispatcher

Memberof

INopeCore

instanceManager: INopeInstanceManager

A Manager, which is capable of creating instance on different Managers in the Network.

Author

M.Karkowski

Memberof

INopeCore

ready: INopeObservable<boolean, boolean, boolean, IEventAdditionalData>

Flag showing, that the system is ready.

Author

M.Karkowski

Memberof

INopeCore

Manager to execute and perform different

Author

M.Karkowski

Memberof

INopeCore

Methods

  • Function used to dispose the Dispatcher. This will dispose all instances an remove the them. They wont be available in the NoPE-Network.

    Author

    M.Karkowski

    Returns

    Memberof

    INopeDispatcher

    Returns Promise<void>

  • Emits an event with the given name. All event-subscriber, where the topic matches will receive this notification.

    Parameters

    • eventName: string
    • data: any

    Returns any

  • Helper to pull some data from the system.

    Type Parameters

    • T = unknown

    • D = null

    Parameters

    • path: string

      The path to the Data.

    • Optional _default: D

      The value to use if no data has been found. If not provided an error is thrown. Defaults to None.

    Returns T

  • Receive the "instances" | "services" | "properties" | "events" which matches with the given pattern. Therefore the user provides the pattern and tyle.

    Author

    M.Karkowski

    Returns

    List of the matching items.

    Memberof

    INopeDispatcher

    Parameters

    • pattern: string

      Pattern to query the provided type.

    • type: "instances" | "services" | "properties" | "events"

      Type which should be querried

    Returns string[]

  • Returns {
        bridge: {
            connected: boolean;
            layers: {
                considerConnection: boolean;
                forwardData: boolean;
                id: string;
                receivesOwnMessages: boolean;
            }[];
        };
        connectivityManager: {
            dispatchers: string[];
        };
        dataDistributor: {
            data: any;
            publishers: {
                name: string;
                schema: INopeDescriptor;
            }[];
            subscribers: {
                name: string;
                schema: INopeDescriptor;
            }[];
        };
        eventDistributor: {
            publishers: {
                name: string;
                schema: INopeDescriptor;
            }[];
            subscribers: {
                name: string;
                schema: INopeDescriptor;
            }[];
        };
        instanceManager: {
            constructors: {
                all: string[];
                internal: string[];
            };
            instances: {
                all: INopeModuleDescription[];
                internal: string[];
            };
        };
        ready: boolean;
        rpcManager: {
            services: {
                all: IServiceOptions<any>[];
                internal: {
                    func: ((...args) => Promise<any>);
                    options: IServiceOptions<any>;
                }[];
            };
            task: {
                executing: string[];
                requested: {
                    id: string;
                    service: string;
                    target: string;
                    timeout: any;
                }[];
            };
        };
    } & INopeStatusInfo

Generated using TypeDoc