is there a way to use respondTextWriter {} but wri...
# ktor
b
is there a way to use respondTextWriter {} but write the http status of the request before the first write operation? something like passing ()->Int instead of the actual status?
what i am trying to do is to transform data from a jdbc resultset to a response as memory efficient as possible. the query runs in a different context so what i do in protocode is:
Copy code
call.respondTextWriter { db.query { write(rs.next())}}
but all exceptions within the respondTextWriter block should actually lead to a different http status code. what i could do is something like
Copy code
db.query{call.respondTextWriter {}}
but i would need something like launch{} in that code and its a bit ugly to pass the call into that function
what i totally want to avoid is collecting all the data from the result set before writing it back
should i go for my own implementation of WriteChannelContent / OutgoingContent?