일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ShapeableImageView
- java
- app-distribution
- google play console
- flowon
- ServerDrivenUI
- 백준
- hotStream
- Flow
- Android
- 백준2309
- collectLatest
- Algorithm
- coldStream
- cancellationException
- Kotlin
- Product Flavor
- Next Challenge
- coroutinescope
- monotone stack
- withContext
- KAKAO
- SDUI
- conflate
- 릴리즈 키해시
- Advanced LCA
- TOSS 과제
- 안드로이드
- coroutine
- coroutinecontext
Archives
- Today
- Total
목록flowon (1)
루피도 코딩한다

Flow에서 Context는 두 가지 관점에서 볼 수 있다. 1) 데이터를 Collect 하는 부분의 Contex와, 2) Emit하는 부분의 Context이다. 1. Consumer의 Context 일반적으로 Collect 되는 부분의 Context는 코루틴이 호출된 곳의 Context를 따른다. 아래와 같이 withContext를 활용해 어떤 Dispatcher를 활용해 데이터를 collect 할지 개발자가 지정할 수 있다. Flow의 이러한 성질을 context preservation(콘텍스트 보존)이라 한다. fun main() = runBlocking { withContext(context) { ✅ simple().collect { value -> println(value) // run in t..
Coroutine
2024. 1. 29. 21:23