Constructs this RPC processor using a FileReader to read RPC commands from and a std.stdio.File to write RPC commands to. Creates this fiber with a reasonable fiber size.
Waits for a response message to a request from the other RPC side. If this is called after the response has already been sent and processed by yielding after sending the request, this will yield forever and use up memory. So it is important, if you are going to await a response, to do it immediately when sending any request.
Calls the window/logMessage method with all arguments concatenated together using text()
Sends a notification with the given method name to the other RPC side without any parameters.
Sends a notification with the given method name to the other RPC side with the given value parameter serialized to JSON.
Sends an RPC response or error. If id, result or error is not given on the response message, they won't be sent. However according to the RPC specification, id must be set in order for this to be a response object. Otherwise on success result must be set or on error error must be set. This also logs the error to stderr if it is given.
Sends an RPC request (method call) to the other side. Doesn't do any additional processing.
Sends a raw JSON object to the other RPC side.
Sends a request with the given method name to the other RPC side without any parameters. Doesn't handle the response by the other RPC side.
Sends a request with the given method name to the other RPC side with the given value parameter serialized to JSON. Doesn't handle the response by the other RPC side.
Sends a request with the given method name to the other RPC side with the given value parameter serialized to JSON. Awaits the response (using yield) and returns once it's there.
Instructs the RPC processor to stop at the next IO read instruction.
Convenience wrapper around WindowFunctions for this.
Fiber which runs in the background, reading from a FileReader, and calling methods when requested over the RPC interface.