Higher order inline functions, and MDCContext

210 Views Asked by At

So I'm trying to write a higher order function that adds Mapped Diagnostic Context (MDC) to a closure that is passed as parameter.

There are two ways to make it work. One for non suspending functions (MDC.put) and one for suspending functions (MDCContext)... But is there a way to make it work in any kind of functions?

I know there's no "suspending variance", other than using the inline modifier, yet...

Just curious!

0

There are 0 best solutions below