ChannelTransport
class ChannelTransport(sendChannel: SendChannel<JSONRPCMessage>, receiveChannel: ReceiveChannel<JSONRPCMessage>, dispatcher: CoroutineDispatcher = Dispatchers.Default) : AbstractClientTransport(source)
A transport implementation that uses Kotlin Coroutines Channels for asynchronous communication of JSON-RPC messages. This is useful in scenarios where communication is message-based and channels are used as the underlying mechanism for delivery.
Parameters
dispatcher
The coroutine dispatcher for the event loop. Defaults to Dispatchers.Default.
Constructors
Link copied to clipboard
constructor(sendChannel: SendChannel<JSONRPCMessage>, receiveChannel: ReceiveChannel<JSONRPCMessage>, dispatcher: CoroutineDispatcher = Dispatchers.Default)
Initializes the transport with the specified SendChannel and ReceiveChannel.
constructor(channel: Channel<JSONRPCMessage> = Channel(UNLIMITED), dispatcher: CoroutineDispatcher = Dispatchers.Default)
Creates a ChannelTransport instance using a single channel for both sending and receiving messages.
Types
Link copied to clipboard
data class LinkedTransports(val clientTransport: ChannelTransport, val serverTransport: ChannelTransport)
Represents a pair of interconnected ChannelTransports for bidirectional communication.