SendStream

An RPC-like stream for sending events and receiving responses for those events. The main use case is communication between the JVM and native code, but it can be used for any bi-directional communication.

The stream is called "SendStream" in the JVM and "ReceiveStream" in the native code.

Docs: https://gp.acrobits.cz/master/documentation/core/android/writing-modern-android/streams

Inheritors

Functions

Link copied to clipboard
abstract override fun close()

Schedule a close event for this stream. After this method is called, the stream will reject any new events.

Link copied to clipboard
abstract suspend fun send(event: Event): Response

Send an event and suspend until the response is available.

Link copied to clipboard
suspend fun <Event, Response> SendStream<Event, Response>.sendAndExpectResponse(event: Event, expectedResponse: Response, actions: suspend () -> Unit)