Как Вы читаете массив байтов из DataRow в C#?

Простой способ в Kotlin - использовать сопрограммы и приостанавливать функции

class YourClass : CoroutineScope {

    // context for main thread
    override val coroutineContext: CoroutineContext
        get() = Dispatchers.Main + Job()

    fun toDoSmth() {
        launch {
            withContext(Dispatchers.IO) {
              // task(1) do smth in another thread
            }
              // do smth in main thread after task(1) is finished
        }
    }
}

. Читайте также о Диспетчерах

.
9
задан p.campbell 15 May 2014 в 04:11
поделиться