A Event Service API provides client side methods to interact with the event server.

interface EventService {
    get(eventKeys: Set<EventKey>): Promise<Event[]>;
    pSubscribe(
        subsystem:
            | "Container"
            | "AOESW"
            | "APS"
            | "CIS"
            | "CLN"
            | "CRYO"
            | "CSW"
            | "DMS"
            | "DPS"
            | "ENC"
            | "ESEN"
            | "ESW"
            | "HNDL"
            | "HQ"
            | "IRIS"
            | "LGSF"
            | "M1COAT"
            | "M1CS"
            | "M1S"
            | "M2COAT"
            | "M2S"
            | "M3S"
            | "MODHIS"
            | "NFIRAOS"
            | "OSS"
            | "REFR"
            | "SCMS"
            | "SER"
            | "SOSS"
            | "STR"
            | "SUM"
            | "TCS"
            | "TINS"
            | "WFOS",
        maxFrequency?: number,
        pattern?: string,
    ): (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription;
    publish(event: Event): Promise<"Done">;
    subscribe(
        eventKeys: Set<EventKey>,
        maxFrequency?: number,
    ): (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription;
    subscribeObserveEvents(
        maxFrequency?: number,
    ): (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription;
}

Methods

  • This API subscribes to events of all the EventKeys specified using a Subsystem and a pattern to match the remaining Event Key and return subscription handle which can be used as a kill switch. It takes callback function which gets triggered when ever the events are received. The latest events available for the given Event Keys will be received first.

    Parameters

    • subsystem:
          | "Container"
          | "AOESW"
          | "APS"
          | "CIS"
          | "CLN"
          | "CRYO"
          | "CSW"
          | "DMS"
          | "DPS"
          | "ENC"
          | "ESEN"
          | "ESW"
          | "HNDL"
          | "HQ"
          | "IRIS"
          | "LGSF"
          | "M1COAT"
          | "M1CS"
          | "M1S"
          | "M2COAT"
          | "M2S"
          | "M3S"
          | "MODHIS"
          | "NFIRAOS"
          | "OSS"
          | "REFR"
          | "SCMS"
          | "SER"
          | "SOSS"
          | "STR"
          | "SUM"
          | "TCS"
          | "TINS"
          | "WFOS"

      subscription to be made under the subsystem

    • OptionalmaxFrequency: number

      the frequency with which events are to be received (in Hz)

    • Optionalpattern: string

      optional pattern to match against the event key.supported glob-style patterns

                         - h?llo subscribes to hello, hallo and hxllo
                         - h*llo subscribes to hllo and heeeello
                         - h[ae]llo subscribes to hello and hallo, but not hillo
      

    Returns (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription

    Subscription

  • This API subscribes to multiple eventKeys and receive events at every frequency and return subscription handle which can be used as a kill switch. It takes callback function which gets triggered when ever the events are received. The latest events available for the given Event Keys will be received first.

    Parameters

    • eventKeys: Set<EventKey>

      Set of event keys to be subscribed.

    • OptionalmaxFrequency: number

      the frequency with which events are to be received (in Hz)

    Returns (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription

    Subscription

  • This API subscribes to all observe events It takes callback function which gets triggered when ever the events are received. The latest events available for the given Event Keys will be received first.

    Parameters

    • OptionalmaxFrequency: number

      the frequency with which events are to be received (in Hz)

    Returns (
        onEvent: (event: Event) => void,
        onError?: (error: ServiceError) => void,
        onClose?: () => void,
    ) => Subscription

    Subscription