[terminal] IJ-CR-160250 Clarify the requirements for the RPC method that returns the channel

GitOrigin-RevId: 5f6c8a84da8062db07067e307c63a8a94cee8559
This commit is contained in:
Konstantin Hudyakov
2025-04-15 07:32:52 +00:00
committed by intellij-monorepo-bot
parent a5942a9eaf
commit ea0c267815
@@ -14,6 +14,11 @@ import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
@Rpc
interface TerminalSessionApi : RemoteApi<Unit> {
/**
* Note, that implementation should return the separate instance of the channel at least for each [com.intellij.codeWithMe.ClientId].
* Because the RPC logic closes the returned channel once the client disconnects,
* so it may interrupt the reading of the channel on the backend.
*/
suspend fun getInputChannel(sessionId: TerminalSessionId): SendChannel<TerminalInputEvent>
suspend fun getOutputFlow(sessionId: TerminalSessionId): Flow<List<TerminalOutputEvent>>