=================
== The Archive ==
=================

[Kotlin Coroutines] 19장. 플로우란 무엇인가?

introduction

1
2
3
interface Flow<out T> {
		suspend fun collect(collector: FlowController<T>)
}

플로우와 값들을 나타내는 다른 방법들의 비교

여러 개의 값을 반환하는 함수

플로우의 특징

플로우 명명법

1
2
3
4
5
6
7
8
suspend fun main() {
		flow { emit("Message 1") }
				.onEach { println(it) }
				.onStart { println("Do something before") }
				.onCompletion { println("Do something after") }
				.catch { emit("Error") }
				.collect { println("Collected $it") }
}

실제 사용 예

요약