Streaming Response Definition Builder
open class StreamingResponseDefinitionBuilder<P : Any, T>(val request: CapturedRequest<P>, var flow: <Error class: unknown class><T>? = null, var chunks: MutableList<T> = mutableListOf(), var delayBetweenChunks: <Error class: unknown class> = Duration.ZERO, httpStatus: <Error class: unknown class> = HttpStatusCode.OK, headers: MutableList<<Error class: unknown class><String, String>> = mutableListOf()) : AbstractResponseDefinitionBuilder<P, T>
A builder for constructing streaming response definitions.
This class is responsible for building instances of StreamResponseDefinition
, which define responses capable of streaming data either as chunks or via a flow.
Parameters
P
The type of the request body.
T
The type of data being streamed.
Constructors
Link copied to clipboard
constructor(request: CapturedRequest<P>, flow: <Error class: unknown class><T>? = null, chunks: MutableList<T> = mutableListOf(), delayBetweenChunks: <Error class: unknown class> = Duration.ZERO, httpStatus: <Error class: unknown class> = HttpStatusCode.OK, headers: MutableList<<Error class: unknown class><String, String>> = mutableListOf())
Properties
Link copied to clipboard
A list of data chunks to be sent as part of the stream, if flow is not provided.
Link copied to clipboard
Link copied to clipboard
A mutable list of header key-value pairs to be included in the response.
Link copied to clipboard
The HTTP status code to be associated with the response.
Link copied to clipboard