Establish a RPC protocol on top of a given channel. By default the rpc protocol is bi-directional, meaning it is possible to send requests and notifications to the remote side (i.e. acts as client) as well as receiving requests and notifications from the remote side (i.e. acts as a server). 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. The bi-directional mode can be reconfigured using the RpcProtocolOptions to construct an RPC protocol instance that acts only as client or server instead.

Constructors

Properties

cancellationTokenSources: Map<number, CancellationTokenSource> = ...
channel: Channel
mode: "default" | "clientOnly" | "serverOnly"
nextMessageId: number = 0
onNotificationEmitter: Emitter<{
    args: any[];
    method: string;
}> = ...

Type declaration

  • args: any[]
  • method: string
pendingRequestCancellationEventListeners: Map<number, DisposableWrapper> = ...
pendingRequests: Map<number, Deferred<any>> = ...
requestHandler: undefined | RequestHandler
toDispose: DisposableCollection = ...
CANCELLATION_TOKEN_KEY: "add.cancellation.token" = 'add.cancellation.token'

Accessors

Methods