ANDROID_LIVE Telegram 1022
Flow опрос #2
#квиз

Первый опрос был выше, и внимательные подписчики заметили, что мы не блокируем функцию main() от завершения. Для упрощения — так и оставлю и в нашем примере, ведь работу этих заданий я тестирую в Kotlin Playground, где все задания успешно выполняются.

Ну и на этот раз — ответ только один.

Итак, что будет в консол
и?

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*

val coroutineScope = CoroutineScope(Dispatchers.Default)

val intFlow = flowOf(1, 2, 3)
val stringFlow = flowOf("a", "b", "c")

fun main() {
coroutineScope.launch {
intFlow
.onEach { delay(100) }
.collect { println(it) }

stringFlow
.collect { println(it) }
}
}
👍19👎5



tgoop.com/android_live/1022
Create:
Last Update:

Flow опрос #2
#квиз

Первый опрос был выше, и внимательные подписчики заметили, что мы не блокируем функцию main() от завершения. Для упрощения — так и оставлю и в нашем примере, ведь работу этих заданий я тестирую в Kotlin Playground, где все задания успешно выполняются.

Ну и на этот раз — ответ только один.

Итак, что будет в консол
и?

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*

val coroutineScope = CoroutineScope(Dispatchers.Default)

val intFlow = flowOf(1, 2, 3)
val stringFlow = flowOf("a", "b", "c")

fun main() {
coroutineScope.launch {
intFlow
.onEach { delay(100) }
.collect { println(it) }

stringFlow
.collect { println(it) }
}
}

BY Android Live 🤖


Share with your friend now:
tgoop.com/android_live/1022

View MORE
Open in Telegram


Telegram News

Date: |

The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added. Telegram users themselves will be able to flag and report potentially false content. The imprisonment came as Telegram said it was "surprised" by claims that privacy commissioner Ada Chung Lai-ling is seeking to block the messaging app due to doxxing content targeting police and politicians. Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data. While some crypto traders move toward screaming as a coping mechanism, many mental health experts have argued that “scream therapy” is pseudoscience. Scientific research or no, it obviously feels good.
from us


Telegram Android Live 🤖
FROM American