-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor/#358] 아티클 읽음 기록 이벤트 처리로 리펙토링 #359
Conversation
@EventListener | ||
fun handleEvent(event: ReadArticleEvent) { | ||
articleViewHisAsyncHandler.addArticleViewHis(event.articleId, event.memberId, event.category) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1차적으로 EventListener에서 이벤트를 받습니다.
|
||
@EventListener | ||
fun handleEvent(event: ReadArticleEvent) { | ||
articleViewHisAsyncHandler.addArticleViewHis(event.articleId, event.memberId, event.category) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventListener에서 받은 이벤트를 2차로 처리합니다.
eg)
articleViewHisAsyncHandler.addArticleViewHis는 이벤트를 비동기로 처리함
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 처리하는게 추후 이벤트를 처리하는 로직이 추가될 때 대응하기 편할 것 같아서 이벤트 처리를 현재 구현과 같이 통일하려 합니다.
🎫 연관 이슈
resolved: #358
💁♂️ PR 내용
🙏 작업
🙈 PR 참고 사항
📸 스크린샷
이벤트 리스너까지는 동기로 이후 이벤트 처리는 비동기로 처리하였는데 스레드 및 트렌잭션이 분리되어 있는 것을 확인하였습니다.
🤖 테스트 체크리스트