what's the fastest, most efficient way to write bi...
# ktor
b
what's the fastest, most efficient way to write big string responses with ktor server netty engine (>200MB)?
b
If it can be splitted into parts that can be fetched, build or constructed individually, I'd use channel response. This way you can start responding while still building the response
b
its basically a really big sql result set
s
respondWrite
appears to be a streaming response:
Copy code
suspend fun ApplicationCall.respondWrite(contentType: ContentType? = null, status: HttpStatusCode? = null, writer: suspend Writer.() -> Unit) {
    val message = WriterContent(writer, defaultTextContentType(contentType), status)
    return respond(message)
}
b
yeah, that's what i am using at the moment call.respondTextWriter in combination with a Sequence generated from sql result set