Package-level declarations

JSON-RPC channel implementation, request/response framing, and notification handling.

JSON-RPC channel implementation, request/response framing, and notification handling.

Types

Link copied to clipboard
data class JsonRpcCallId(val id: JsonPrimitive) : RpcCallId

JSON-RPC RpcCallId: wraps the request's id primitive so cancellation can be routed by the original request identifier.

Link copied to clipboard

Protocol-agnostic cancellation convention for JSON-RPC.

Link copied to clipboard
sealed interface JsonRpcContextConvention

Convention for carrying @KsContext wire-context entries over JSON-RPC.

Functions

Link copied to clipboard
suspend fun Pair<ByteReadChannel, ByteWriteChannel>.asJsonRpcConnection(env: KsrpcEnvironment<String>, includeContentHeaders: Boolean = true, cancellationConvention: JsonRpcCancellationConvention = JsonRpcCancellationConvention.None, contextConvention: JsonRpcContextConvention = JsonRpcContextConvention.RootSiblings): SingleChannelConnection<String>

Create a SingleChannelConnection that starts the process and uses the Process.getInputStream and Process.getOutputStream as the streams for communication using jsonrpc.

Helper that calls into Pair.asJsonRpcConnection.

Link copied to clipboard

Create a SingleChannelConnection that communicates over the std in/out streams of this process using jsonrpc.