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

sitepodmatt

02/16/2019, 4:18 AM
I want to register some information to flow along a chain of suspending method calls. Kind of like putting something in thread local storage when using a thread request e.g. tls["workingOn"] = "transforming quote #102345 to order". we've used something like this with nodejs before (https://github.com/vicanso/async-local-storage)
g

gildor

02/16/2019, 10:11 AM
There is coroutine context that can replace thread local, you can pass any information to any coroutine using it
s

sitepodmatt

02/17/2019, 2:14 AM
I started using context a few posts down, but I guess I want to intercept where the graph branches (if one thinks of it like a graph where runBlocking main is the root node) and then copy the wrapped data structure in the coroutine element, new scope simply copy by the elements into themselves
5 Views