RPCProcessor

Fiber which runs in the background, reading from a FileReader, and calling methods when requested over the RPC interface.

Constructors

this
this(FileReader reader, File writer)

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.

Members

Functions

awaitResponse
ResponseMessageRaw awaitResponse(RequestToken tok, Duration timeout)

Waits for a response message to a request from the other RPC side.

hasData
bool hasData()
log
void log(Args args)

Calls the window/logMessage method with all arguments concatenated together using text()

notifyMethod
void notifyMethod(string method)

Sends a notification with the given method name to the other RPC side without any parameters.

notifyMethod
void notifyMethod(string method, T value)
deprecated void notifyMethod(string method, JSONValue value)
void notifyMethod(string method, JsonValue value)
notifyMethodRaw
void notifyMethodRaw(string method, const(char)[] value)

Sends a notification with the given method name to the other RPC side with the given value parameter serialized to JSON.

notifyProgressRaw
void notifyProgressRaw(const(char)[] token, const(char)[] value)
Undocumented in source. Be warned that the author may not have intended to support it.
poll
RequestMessageRaw poll()
registerCapability
void registerCapability(const(char)[] id, const(char)[] method, T options)
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(ResponseMessage res)
void send(ResponseMessageRaw res)

Sends an RPC response or error. If result or error is not given on the response message, they won't be sent. 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.

send
void send(RequestMessage req)
void send(RequestMessageRaw req)

Sends an RPC request (method call) to the other side. Doesn't do any additional processing.

send
deprecated void send(JSONValue raw)

Sends a raw JSON object to the other RPC side.

sendMethod
RequestToken sendMethod(string method)

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.

sendMethod
RequestToken sendMethod(string method, T value)
deprecated RequestToken sendMethod(string method, JSONValue value)
RequestToken sendMethod(string method, JsonValue value)
sendMethodRaw
RequestToken sendMethodRaw(string method, const(char)[] value)

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.

sendRawPacket
void sendRawPacket(const(char)[] rawJson)
void sendRawPacket(const(char)[][] parts)

Sends a raw JSON object to the other RPC side.

sendRequest
ResponseMessageRaw sendRequest(string method, T value, Duration timeout)
deprecated ResponseMessageRaw sendRequest(string method, JSONValue value, Duration timeout)
ResponseMessageRaw sendRequest(string method, JsonValue value, Duration timeout)

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.

stop
void stop()

Instructs the RPC processor to stop at the next IO read instruction.

window
WindowFunctions window()

Convenience wrapper around WindowFunctions for this.

Meta