Skip to content
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

fix(decoder): move decoder to interceptor head #325

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

GStones
Copy link
Collaborator

@GStones GStones commented Jun 18, 2024

  • decoder 移动到Interceptors最前面,方便后面添加一些中间件可以获取当前msg的一些基本信息

@GStones GStones self-assigned this Jun 18, 2024
@GStones GStones requested a review from aceld June 18, 2024 07:20
if s.decoder != nil {
s.msgHandler.AddInterceptor(s.decoder)
s.msgHandler.SetHeadInterceptor(s.decoder)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方将AddInterceptor() 改成 SetHeadInterceptor() ,目的是不是默认强制将Server.Decoder作为第一个拦截器?也就是在启动Server之前全部的server.AddInterceptor() 方法添加的拦截器,都会排在decoder之后?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,默认强制将Server.Decoder作为第一个拦截器

@aceld aceld merged commit b5af367 into master Jun 18, 2024
1 check passed
@GStones GStones deleted the fix/fix-decoder-interceptor branch June 19, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants