옵저버 패턴에서 Kotlin 흐름 API의 도출

Derivation of Kotlin Flow API from Observer Pattern

초록

Kotlin Flow is an asynchronous reactive stream library developed on top of Kotlin coroutine’s suspending functions. Recently, many reactive applications have increasingly adopted the Kotlin Flow instead of the well-known, but nevertheless heavy-weight, RxJava because it provides back-pressure support naturally by using coroutine’s suspending functions. However, the workings of the Flow API are difficult for most programmers to understand. One of the main reasons is due to the ignorance of the fact that its API is originated from the Observer Pattern, as well as its inherent reactive nature. In this paper, we show that Kotlin Flow API is nothing but a reactive version of the adapted Observer Pattern, together with Kotlin coroutines, by step-by-step illumination of how its API is derived from both the Observer Pattern and Kotlin’s coroutine.

키워드

코틀린 흐름코루틴설계 패턴리액티브 스트림Kotlin flowKotlin coroutinedesign patternreactive stream
제목
옵저버 패턴에서 Kotlin 흐름 API의 도출
제목 (타언어)
Derivation of Kotlin Flow API from Observer Pattern
저자
김정선
DOI
10.5626/JOK.2023.50.9.821
발행일
2023-09
저널명
정보과학회논문지
50
9
페이지
821 ~ 826