zeed
    Preparing search index...

    Class Emitter<RemoteListener, LocalListener>

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _logEmitter: LoggerInterface = ...
    call: RemoteListener = ...

    RPC like emitting of events.

    Methods

    • Emits an event to all subscribers and executes their corresponding event handlers.

      Type Parameters

      • U extends string | number | symbol

      Parameters

      • event: U

        The event to emit.

      • ...args: Parameters<RemoteListener[U]>

        The arguments to pass to the event handlers.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating whether the event was successfully emitted.

    • Emits an event to all subscribers and executes their corresponding event handlers.

      Type Parameters

      • U extends string | number | symbol

      Parameters

      • event: U

        The event to emit.

      • ...args: Parameters<RemoteListener[U]>

        The arguments to pass to the event handlers.

      Returns Promise<ReturnType<RemoteListener[U]> | undefined>

      A promise that resolves to the result of the first subscriber's handler, or undefined if no subscribers are present.

    • Emits an event to all subscribers and executes their corresponding event handlers.

      Type Parameters

      • U extends string | number | symbol

      Parameters

      • event: U

        The event to emit.

      • ...args: Parameters<RemoteListener[U]>

        The arguments to pass to the event handlers.

      Returns Promise<ReturnType<RemoteListener[U]>[] | undefined>

      A promise that resolves to an array of results from all subscribers, or undefined if no subscribers are present.

    • Type Parameters

      Parameters

      • event: U
      • timeoutMS: number = 1000

      Returns Promise<R>