Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinFlow cold streamsSingle-choice MCQ

How many times is "producing" printed when this cold Flow is collected twice?

import kotlinx.coroutines.flow.* val numbers = flow { println("producing") emit(1) emit(2) } suspend fun run() { numbers.collect { } numbers.collect { } }