A Dispatcher to perform a function on a Remote Dispatcher. Therefore a Task is created and forwarded to the remote.

For a detailled description please checkout INopeRpcManager

Export

Type Parameters

Hierarchy

  • NopeRpcManager

Implements

Constructors

Properties

methodInterface: {
    [index: string]: (<T>(...args) => INopePromise<T>);
}

Proxy for accessing the Methods. This proxy provides additional options, which can be used to detail the calls.

Author

M.Karkowski

Memberof

NopeRpcManager

Type declaration

methodInterfaceWithOptions: {
    [index: string]: (<T>(options, ...args) => INopePromise<T>);
}

Proxy for accessing the Methods. This proxy provides additional options, which can be used to detail the calls.

Author

M.Karkowski

Memberof

NopeRpcManager

Type declaration

An event Emitter, which will be called when a task is getting canceled.

Author

M.Karkowski

Memberof

NopeRpcManager

The Options, used by the rpc-manager.

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

Flag to indicate, that the system is ready.

Author

M.Karkowski

Memberof

NopeRpcManager

services: IMapBasedMergeData<string, IAvailableServicesMsg, string, T>

Element showing the available services. Its more or less a map, that maps the services with their dispatchers.

  • OriginalKey = Dispatcher ID (string)
  • OriginalValue = Original Message (IAvailableServicesMsg)
  • ExtractedKey = Function ID (string);`
  • ExtractedValue = FunctionOptions (T)

Author

M.Karkowski

Memberof

INopeRpcManager

Methods

  • Helper to cancel all Tasks which have been requested by a Dispatcher.

    Author

    M.Karkowski

    Memberof

    NopeRpcManager

    Parameters

    • dispatcher: string
    • reason: Error

    Returns Promise<void>

  • Function to cancel an indivual Task. This might be the case, if a connection to a specific dispatcher is lost or might have a user-based reason.

    Returns

    Flag, that indicates, whether cancelation was sucessfull or not.

    Memberof

    nopeDispatcher

    Parameters

    • taskId: string

      The Id of the Task. Which should be canceled.

    • reason: Error

      The Reason, why the Task should be canceled (In general shoudl be something meaning full)

    • quiet: boolean = false

    Returns Promise<boolean>

  • Function to register a Function in the Dispatcher

    Returns

    The registered Function

    Memberof

    nopeDispatcher

    Parameters

    • func: ((...args) => Promise<any>)

      The function which should be called if a request is mapped to the Function.

        • (...args): Promise<any>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<any>

    • options: {
          addNopeServiceIdPrefix?: boolean;
      } & T

      Options to enhance the registered ID and enabling unregistering the Element after calling it.

    Returns Promise<((...args) => Promise<any>)>

  • Helper to remove a dispatcher. This leads to closing all open task related to this dispatcher -> Exceptions should be thrown. Additional, internal task, requested by the dispatcher will be canceled.

    Author

    M.Karkowski

    Memberof

    NopeRpcManager

    Parameters

    • dispatcher: string

    Returns void

  • Describes the Data.

    Returns

    Returns {
        services: {
            all: T[];
            internal: {
                func: ((...args) => Promise<any>);
                options: T;
            }[];
        };
        task: {
            executing: string[];
            requested: {
                id: string;
                service: string;
                target: string;
                timeout: any;
            }[];
        };
    }

    • services: {
          all: T[];
          internal: {
              func: ((...args) => Promise<any>);
              options: T;
          }[];
      }
      • all: T[]
      • internal: {
            func: ((...args) => Promise<any>);
            options: T;
        }[]
    • task: {
          executing: string[];
          requested: {
              id: string;
              service: string;
              target: string;
              timeout: any;
          }[];
      }
      • executing: string[]
      • requested: {
            id: string;
            service: string;
            target: string;
            timeout: any;
        }[]
  • Function to unregister a Function from the Dispatcher

    Returns

    Flag, whether the element was removed (only if found) or not.

    Memberof

    nopeDispatcher

    Parameters

    • func: string | ((...args) => void)

      The Function to unregister

    Returns Promise<boolean>

Generated using TypeDoc