Hello, I'm looking to use MDC in my Kotlin backend and I have a question on how I could implement it. I currently have just simple Lambdas, so my code is something like
override fun handleRequest(inputStream: InputStream, outputStream: OutputStream, context: Context) = runBlocking(Dispatchers.Default) {
stuff()
}
From a few implementations I see, it seems it is a simple addition of
MDCContext()
to
Dispatchers.Default
, so
override fun handleRequest(inputStream: InputStream, outputStream: OutputStream, context: Context) = runBlocking(Dispatchers.Default + MDCContext()) {
stuff()
}
Does this make sense to you?