Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProxyComponent

Proxy component class

param

current application context

param

construct parameters

Hierarchy

  • ProxyComponent

Implements

Index

Constructors

constructor

Properties

app

client

client: RpcClient

name

name: string = "__proxy__"

opts

Methods

addServers

  • addServers(servers: ServerInfo[]): void
  • Add remote server to the rpc client.

    Parameters

    • servers: ServerInfo[]

      server info list, {id, serverType, host, port}

    Returns void

afterStart

  • afterStart(cb: function): void
  • Component lifecycle callback

    Parameters

    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

removeServers

  • removeServers(ids: string[]): void
  • Remove remote server from the rpc client.

    Parameters

    • ids: string[]

      server id list

    Returns void

replaceServers

  • replaceServers(servers: ServerInfo[]): void
  • Replace remote servers from the rpc client.

    Parameters

    • servers: ServerInfo[]

    Returns void

rpcInvoke

  • rpcInvoke(serverId: string, msg: any, cb: function): void
  • Proxy for rpc client rpcInvoke.

    Parameters

    • serverId: string

      remote server id

    • msg: any

      rpc message: {serverType: serverType, service: serviceName, method: methodName, args: arguments}

    • cb: function

      callback function

        • (err: Error, ...args: any[]): void
        • Parameters

          • err: Error
          • Rest ...args: any[]

          Returns void

    Returns void

start

  • start(cb: function): void
  • Proxy component lifecycle function

    Parameters

    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void