Options
All
  • Public
  • Public/Protected
  • All
Menu

Establish a bi-directional RPC protocol on top of a given channel. Bi-directional means to send sends requests and notifications to the remote side as well as receiving requests and notifications from the remote side. Clients can get a promise for a remote request result that will be either resolved or rejected depending on the success of the request. Keeps track of outstanding requests and matches replies to the appropriate request Currently, there is no timeout handling for long running requests implemented.

Hierarchy

  • RpcProtocol

Index

Constructors

Properties

cancellationTokenSources: Map<number, CancellationTokenSource> = ...
channel: Channel
nextMessageId: number = 0
onNotificationEmitter: Emitter<{ args: any[]; method: string }> = ...
pendingRequests: Map<number, Deferred<any>> = ...
requestHandler: RequestHandler
toDispose: DisposableCollection = ...
CANCELLATION_TOKEN_KEY: "add.cancellation.token" = 'add.cancellation.token'

Accessors

  • get onNotification(): Event<{ args: any[]; method: string }>

Methods

  • cancelError(): Error
  • handleCancel(id: number): void
  • handleNotify(id: number, method: string, args: any[]): Promise<void>
  • handleReply(id: number, value: any): void
  • handleReplyErr(id: number, error: any): void
  • handleRequest(id: number, method: string, args: any[]): Promise<void>
  • sendCancel(requestId: number): void
  • sendNotification(method: string, args: any[]): void
  • sendRequest<T>(method: string, args: any[]): Promise<T>