import { Session } from "https://deno.land/x/vim_channel_command@v3.1.1/mod.ts";
Session is a wrapper of ReadableStream and WritableStream to send commands and receive messages.
Constructors
Constructs a new session.
Properties
The callback function to be called when an invalid message is received. The default behavior is to ignore the message.
The callback function to be called when a message is received. The default behavior is to ignore the message.
Methods
Shutdown the session forcibly. If the session is not running, the promise will be rejected with Error.
Receive a message from the peer. If the session is not running or the message ID is already reserved, the promise will be rejected with Error.
Send a command or a message to the peer. If the session is not running, the promise will be rejected with Error.
Shutdown the session. If the session is not running, the promise will be rejected with Error.
Start the session.
This method must be called before calling send
or recv
.
If the session is already running, this method throws an error.
The session is started in the following steps:
Wait until the session is shutdown. If the session is not running, the promise will be rejected with Error.