Created
September 17, 2018 07:50
-
-
Save zach-klippenstein/8b64b2bc99fcbdaa0849b562c43be716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CoroutineNamesTest { | |
@Test fun coroutineNames() { | |
runBlocking(CoroutineName("parent")) { | |
println("parent: $coroutineContext") | |
launch { | |
println("unnamed child: $coroutineContext") | |
} | |
launch(CoroutineName("named child")) { | |
println("named child: $coroutineContext") | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parent: [CoroutineName(parent), CoroutineId(1), "parent#1":BlockingCoroutine{Active}@47d384ee, BlockingEventLoop@2d6a9952] | |
unnamed child: [CoroutineName(parent), CoroutineId(2), "parent#2":StandaloneCoroutine{Active}@2aafb23c, BlockingEventLoop@2d6a9952] | |
named child: [CoroutineName(named child), CoroutineId(3), "named child#3":StandaloneCoroutine{Active}@2eee9593, BlockingEventLoop@2d6a9952] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment