Class RPCServer

Hierarchy

  • StartStop
    • RPCServer

Constructors

Properties

[initLock]: RWLockWriter
activeStreams: Set<PromiseCancellable<void>> = ...
defaultTimeoutMap: Map<string, undefined | number> = ...
fromError: FromError
handlerMap: Map<string, RawHandlerImplementation> = ...
idGen: IdGen
logger: Logger
middlewareFactory: MiddlewareFactory<JSONRPCRequest, Uint8Array, Uint8Array, JSONRPCResponseSuccess>
onTimeoutCallback?: (() => void)

Type declaration

    • (): void
    • Returns void

replacer?: ((key, value) => any)

Type declaration

    • (key, value): any
    • Parameters

      • key: string
      • value: any

      Returns any

timeoutTime: number

Accessors

  • get [eventHandled](): ReadonlyWeakSet<Event>
  • Returns ReadonlyWeakSet<Event>

  • get [eventHandlers](): ReadonlyMap<string, Set<EventHandlerInfo>>
  • Returns ReadonlyMap<string, Set<EventHandlerInfo>>

  • get [eventTarget](): EventTarget
  • Returns EventTarget

  • get [handleEventError](): ((evt) => void)
  • Returns ((evt) => void)

      • (evt): void
      • Parameters

        • evt: EventError

        Returns void

  • get [running](): boolean
  • Returns boolean

  • get [statusP](): Promise<Status>
  • Returns Promise<Status>

  • get [status](): Status
  • Returns Status

Methods

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • ID is associated with the stream, not individual messages.

    Parameters

    Returns void

  • The ID is generated only once when the function is called and stored in the id variable. the ID is associated with the entire stream Every response (whether successful or an error) produced within this stream will have the same ID, which is consistent with the originating request.

    Type Parameters

    Parameters

    Returns void

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Registers a raw stream handler. This is the basis for all handlers as handling the streams is done with raw streams only. The raw streams do not automatically refresh the timeout timer when messages are sent or received.

    Parameters

    Returns void

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Starts RPC server.

    Parameters

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          force?: boolean;
          reason?: any;
      }
      • Optional force?: boolean
      • Optional reason?: any

    Returns Promise<void>

Generated using TypeDoc