sse
Initiates a Server-Sent Events (SSE) streaming operation over an HTTP POST request.
This function sends a request to the specified path
with the given request
payload, processes the streamed chunks of data from the server, and emits the processed results as a flow of strings.
Return
A Flow emitting processed strings derived from the streamed chunks of data.
Parameters
The endpoint path to which the SSE POST request is sent.
The request payload to be sent in the POST request.
The Kotlin class reference representing the type of the request body.
A lambda function that determines whether a received streaming data chunk should be processed. It takes the raw data as a string and returns true
if the data should be included, or false
otherwise. Defaults to accepting all non-null chunks.
A lambda function used to decode the raw streaming response data into the target type. It takes a raw string and converts it into an object of type R
.
A lambda function that processes the decoded streaming chunk and returns a string result. If the returned value is null
, the chunk will not be emitted to the resulting flow.