본문 바로가기

combine9

[Combine] 스케줄링을 위한 subscribe(on:)과 receive(on:)의 원리 (with OpenCombine) Combine 탐구 시리즈 1. Publisher와 Subscriber 그리고 Subscription(with OpenCombine) 2. Cancellable 탐구 (with OpenCombine) 3. Combine과 Backpressure (with OpenCombine, RxSwift) 오늘은 OpenCombine을 기반으로 Combine에 대해 Deep Dive 하는 4번째 글입니다! 많은 분들이 사용하고 있지만 정확히 어떻게 동작하는지 잘 모르는 스케줄러 지정 연산자(Sepecifying Schedulers)가 주제입니다. 이번 글은 Combine의 구독 생성 과정에 대한 사전 지식이 필요합니다. 제 지난 글의 내용이 사전 지식으로 필요하니 참고 부탁드립니다!! Specifying Schedu.. 2024. 1. 16.
[Combine] Combine과 Backpressure (with OpenCombine, RxSwift) Combine 탐구 시리즈 1. Publisher와 Subscriber 그리고 Subscription(with OpenCombine) 2. Cancellable 탐구 (with OpenCombine) 오늘은 OpenCombine을 기반으로 Combine의 Backpressure 전략에 대해 알아보도록 하겠습니다!! 추가로 RxSwift의 Backpressure와의 차이점에 대해서도 살펴보겠습니다. Backpressure란? Backpressure라는 단어 자체를 처음 들어본 분들도 꽤 있을 것 같습니다. 저 또한 익숙한 단어는 아니었는데 사전적 의미는 다음과 같습니다. "기체를 배출하는 쪽의 압력"이라고 용어 사전에 적혀있습니다. 배압 또는 역압이라고도 하며 흐름 방향의 반대 압력을 막연하게 배압(bac.. 2023. 12. 14.
[Combine] Cancellable 탐구 (with OpenCombine) Combine 탐구 시리즈 1. Publisher와 Subscriber 그리고 Subscription(with OpenCombine) 지난번 Publisher, Subscriber, Subscription 학습에 이어서 오늘은 Combine의 Cancellable에 대해 깊게 공부해 보도록 하겠습니다. 오늘도 역시 OpenCombine을 기반으로 코드 레벨까지 내려가 Combine에서 Cancel이 발생하는 과정에 대해 살펴보겠습니다. Cancel은 무엇일까? 우선 가장 먼저 생각해봐야 할 것은 cancel 자체에 대한 개념입니다. Combine에서는 cancel을 공식적으로 지원합니다. 공식 문서를 보면 Cancellable 프로토콜이 cancel 함수를 명시하고 있습니다. 이 함수의 역할은 Cance.. 2023. 11. 22.
[Combine] Publisher와 Subscriber 그리고 Subscription (with OpenCombine) 최근 Combine 스터디를 진행하면서 단순히 Combine의 사용법을 넘어 코드 레벨에서의 학습에 대한 흥미가 생겼습니다. 마침 스터디를 같이 하고 있는 분이 좋은 자료를 알려주셨는데 바로 OpenCombine입니다. 애플에서는 기본적으로 Combine의 구현 코드를 공개하고 있지 않습니다. 따라서, 개발자들은 내부적인 동작 원리를 유추하거나 RxSwift의 코드를 참고해서 파악할 수 밖에 없었는데 마침 해외의 어떤 개발자분이 Combine을 직접 구현해서 공개를 한 레포지토리가 있었습니다. https://github.com/OpenCombine/OpenCombine GitHub - OpenCombine/OpenCombine: Open source implementation of Apple's Comb.. 2023. 11. 15.
Combine in Practice https://developer.apple.com/videos/play/wwdc2019/721/ Combine in Practice - WWDC19 - Videos - Apple Developer Expand your knowledge of Combine, Apple's new unified, declarative framework for processing values over time. Learn about how to... developer.apple.com 코드에서는 value 또는 이벤트 Publisher와 해당 퍼블리셔로부터 값을 수신하는 데 관심이 있는 Subscriber가 있는 곳이 많다. 그리고 어떤 이해 관계자(interestd party)가 나타나서 이 두 당사자 사이에 연결을 설정한.. 2023. 10. 24.
Introducing Combine https://developer.apple.com/videos/play/wwdc2019/722/ Introducing Combine - WWDC19 - Videos - Apple Developer Combine is a unified declarative framework for processing values over time. Learn how it can simplify asynchronous code like networking,... developer.apple.com 예제 앱 사용자 이름과 비밀번호를 입력 받아 회원가입을 해야하는 간단한 요구사항이 있다. 이름을 입력하게 되면 위의 사진처럼 많은 비동기 동작이 진행된다. Target/Action을 사용해 사용자가 입력하는 것에 대한 notifi.. 2023. 10. 23.