Skip to content

Commit 968a2af

Browse files
authored
Create ReactorPattern.md
1 parent 4d11dd2 commit 968a2af

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

designpattern/ReactorPattern.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Reactor Pattern
2+
[The reactor design pattern is an event handling pattern for handling service requests delivered concurrently
3+
to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and
4+
dispatches them synchronously to the associated request handlers.](https://en.wikipedia.org/wiki/Reactor_pattern#Implementations)
5+
> 하나 이상의 입력이 서비스 핸들러에 동시에 전달되는 서비스 요청을 처리하기 위한 이벤트 처리 패턴
6+
7+
Reactor 는 이벤트가 발생하기를 기다리고, 이벤트가 발생하면 Reactor 는 이벤트를 적절한 이벤트 핸들러에 넘겨주는 역할을 한다.
8+
동작방식은 크게 다섯 과정을 거친다.
9+
- Initiate: 이벤트에 반응하는 reactor 를 만들고 reactor 에 이벤트를 처리할 이벤트 핸들러를 등록
10+
- Receive: reactor 는 이벤트 발생을 수신
11+
- **Demultiplex**: 이벤트를 처리할 이벤트 핸들러 단위로 분할
12+
- Dispatch: 분할된 이벤트를 해당 이벤트 핸들러에 발송
13+
- Process event: 이벤트핸들러에서 이벤트 처리

0 commit comments

Comments
 (0)