Last active
July 22, 2024 02:36
-
-
Save sftblw/89423e6c7ee4e55de9f73bd582433a4a to your computer and use it in GitHub Desktop.
CoroutineDebugConfig (ChatGPT's suggesstion)
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
import jakarta.annotation.PostConstruct | |
import jakarta.annotation.PreDestroy | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.debug.DebugProbes | |
import org.springframework.context.annotation.Configuration | |
// https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-debug/ | |
@Configuration | |
class CoroutineDebugConfig { | |
@OptIn(ExperimentalCoroutinesApi::class) | |
@PostConstruct | |
fun setUp() { | |
DebugProbes.install() | |
} | |
@OptIn(ExperimentalCoroutinesApi::class) | |
@PreDestroy | |
fun tearDown() { | |
DebugProbes.uninstall() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment