rc.response is not doing anything related to promises, it holds some state that creates a response buffer, passes that to the code block, then sends it off to the network.
Copy code
val target = ...
val res = makeResponseBuffer()
fun responseFn(f: ((ResponseBuffer) -> Unit)) {
f(res)
network.send(target, res.toByteArray())
res.reset()
}