Skip to content

Commit 748dea6

Browse files
committed
0804그래프 수정
1 parent ba7f1e3 commit 748dea6

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

_posts/2025-08-04-Spring_Reactive(1).md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,26 @@ public interface Publisher<T> {
6363
이제 다시 처음의 질문으로 돌아와 보자. 왜 **`X튜브 채널.구독(구독자)`** 의 형태일까? 바로 이 역압력 메커니즘을 가장 효율적으로 구현하기 위한 설계이기 때문이다. 둘의 '구독' 과정, 즉 최초의 '악수(Handshake)' 과정을 단계별로 살펴보면 그 이유가 명확해진다.
6464

6565
```
66-
Subscriber | Subscription | Publisher
67-
| | | |
68-
| | | |
69-
| <--- 1. subscribe(this) 호출됨 -------- | | (외부에서 publisher.subscribe(subscriber) 실행)
70-
| | | |
71-
| | | -- 2. Subscription 생성 --> |
72-
| | | |
73-
| -- 3. onSubscribe(subscription) 호출 -->| |
74-
| | | |
75-
| (Subscriber가 '리모컨'을 전달받음) |
76-
| | | |
77-
| | <--- 4. request(n) ----- | | (데이터 n개 요청) | |
78-
| | | |
79-
| | | | (요청받은 개수만큼 데이터 생성)
80-
| | | |
81-
| <--- 5. onNext(data) ------------------| | (데이터 전달) |
82-
| | | |
83-
| <--- 5. onNext(data) ------------------| | (... n번 반복 ...)
84-
| | | |
85-
| <--- 6. onComplete() / onError() ------| | (스트림 종료)
86-
| | | |
66+
Application/Client Subscriber Subscription Publisher
67+
| | | | |
68+
| | | | |
69+
// 1. 외부에서 구독 시작
70+
| -- publisher.subscribe(subscriber) -------------------------------------->|
71+
| | | | |
72+
| | | | // 2. Publisher가 Subscription 생성
73+
| | | | 및 Subscriber의 onSubscribe 호출
74+
| | <---- onSubscribe(subscription) ------------------ |
75+
| | | | |
76+
// 3. Subscriber가 제어권을 갖고 데이터 요청
77+
| | --- request(n) ----> | | |
78+
| | | | |
79+
| | | | // 4. Publisher가 요청에 맞춰 데이터 생성 및 전송
80+
| | <---- onNext(data) --------------------------------|
81+
| | <---- onNext(data) --------------------------------|
82+
| | | | |
83+
// 5. 데이터 전송 완료 또는 에러
84+
| | <---- onComplete() / onError() --------------------|
85+
| | | | |
8786
8887
```
8988

0 commit comments

Comments
 (0)