示例代码中的注释说明了delay()是非阻塞的。它应该暂停吗?https://kotlinlang.org/docs/reference/coroutines/basics.html fun main() { delay(1000L) // non-blocking delay for 1 second (default time unit is ms)
println("World!") //
这是关于runBlocking的错误用法吗?正如"runBlocking“docs所说的那样,This function should not be used from coroutine。 fun start(facing: CameraFacing) { runBlocking { cameraFa
我有一个第三方库,它定期向我的视频播放器(ExoPlayer)查询视频中的当前位置等信息。此第三方库在后台线程上运行。问题是,后台线程不允许访问ExoPlayer实例。我的一个想法是在访问ExoPlayer实例之前使用协程强制切换到主线程。类似这样的东西(请注意,这是从多个地方调用的,包括在主线程和后台线程上):
suspend fun getCurrentPos