https://kotlinlang.org logo
#coroutines
Title
# coroutines
n

nhellwig

12/01/2017, 3:00 PM
Hi, is there a way to also intercept when a coroutine suspends. I got it working for resume with the CoroutineInterceptor. The reason why I need this is for instructing the logging framework with fields (https://logback.qos.ch/manual/mdc.html) for logging.
e

elizarov

12/01/2017, 3:13 PM
It resumes when intercepted continuation gets
resume
invocation, it suspends when that
resume
invocation returns, so you do MDC save/load around delegate call to
resume
from your interceptor
n

nhellwig

12/01/2017, 3:14 PM
oh nice, thanks for the quick response!
2 Views