class Session
implements Disposable
import { Session } from "https://deno.land/x/msgpack_rpc@v4.0.0/mod.ts";
MessagePack-RPC Session
Constructors
new
Session(reader: Deno.Reader & Deno.Closer,
writer: Deno.Writer,
dispatcher?: Dispatcher,
options?: SessionOptions,
Methods
private
dispatch(method: string, ...params: unknown[]): Promise<unknown>private
handleNotification(notification: message.NotificationMessage): Promise<void>private
handleRequest(request: message.RequestMessage): Promise<void>private
handleResponse(response: message.ResponseMessage): voidprivate
listen(): Promise<void>private
send(data: Uint8Array): Promise<void>call(method: string, ...params: unknown[]): Promise<unknown>
Call a method with params and return a Promise which resolves when a response message has received and to the result value of the method.
dispose()
notify(method: string, ...params: unknown[]): Promise<void>
Notify a method with params and return a Promise which resolves when the message has sent.