Options
All
  • Public
  • Public/Protected
  • All
Menu

Connection wraps GRPC hosts. Note that this wraps the hosts themselves; each host can contain multiple discreet services.

Hierarchy

  • ConnectionPool

Implements

Index

Constructors

constructor

Properties

Readonly callOptionsFactory

callOptionsFactory: undefined | CallOptions | ((context: CallContext) => CallOptions) = this.options.defaultCallOptions

Static deterministicOrder

deterministicOrder: boolean = false

Toggles whether hosts are looped through in a deterministic order. For use in tests, should not be toggled in production/

Methods

close

  • close(): void

exec

  • exec<T>(serviceName: keyof typeof Services, method: string, payload: unknown, options?: grpc.CallOptions): Promise<T>
  • override

    Type parameters

    • T

    Parameters

    • serviceName: keyof typeof Services
    • method: string
    • payload: unknown
    • Optional options: grpc.CallOptions

    Returns Promise<T>

markFailed

  • markFailed(resource: Host, error: Error): void

mock

unmock

  • unmock(): void

withConnection

  • withConnection<T>(service: keyof typeof Services, fn: (args: { client: Client; metadata: Metadata; resource: Host }) => Promise<T> | T, shuffleGenerator?: Generator<Host, void, unknown>): Promise<T>
  • override

    Type parameters

    • T

    Parameters

    • service: keyof typeof Services
    • fn: (args: { client: Client; metadata: Metadata; resource: Host }) => Promise<T> | T
        • (args: { client: Client; metadata: Metadata; resource: Host }): Promise<T> | T
        • Parameters

          • args: { client: Client; metadata: Metadata; resource: Host }
            • client: Client
            • metadata: Metadata
            • resource: Host

          Returns Promise<T> | T

    • Default value shuffleGenerator: Generator<Host, void, unknown> = this.shuffledHosts()

    Returns Promise<T>

Legend

  • Constructor
  • Method
  • Inherited method

Generated using TypeDoc