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

Support user interceptor of server #2137

Merged
merged 4 commits into from
Apr 26, 2023
Merged

Conversation

chenBright
Copy link
Contributor

What problem does this PR solve?

Issue Number: #2134

Problem Summary:
支持自定义服务端拒绝(拦截器)

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

src/brpc/policy/baidu_rpc_protocol.cpp Outdated Show resolved Hide resolved
src/brpc/server.cpp Outdated Show resolved Hide resolved
@wwbmmm
Copy link
Contributor

wwbmmm commented Feb 28, 2023

LGTM

1 similar comment
@serverglen
Copy link
Contributor

LGTM

@serverglen
Copy link
Contributor

LGTM
I think this PR can be merged

@Huixxi Huixxi added the feature new feature label Apr 10, 2023
@chenBright
Copy link
Contributor Author

LGTM I think this PR can be merged

+1 @wwbmmm

@wwbmmm wwbmmm merged commit 5694646 into apache:master Apr 26, 2023
@chenBright chenBright deleted the user_interceptor branch April 26, 2023 08:17
@yanglimingcn
Copy link
Contributor

这个能支持按照不同请求类型,或者根据请求里面的一些信息做拦截策略吗?如果支持,可能让用户基于此可以用来定义一个qos算法。

@yanglimingcn
Copy link
Contributor

也许controller里面加上request指针就可以做到。

@chenBright
Copy link
Contributor Author

这个能支持按照不同请求类型,或者根据请求里面的一些信息做拦截策略吗?如果支持,可能让用户基于此可以用来定义一个qos算法。

Controller::method()应该可以用来区分请求类型吧

yanglimingcn pushed a commit to yanglimingcn/brpc that referenced this pull request Jun 25, 2023
* Support user interceptor of server

* Optimize interceptor unittest

* Optimize interceptor

* interceptor return quickly
yanglimingcn pushed a commit to yanglimingcn/brpc that referenced this pull request Oct 31, 2023
* Support user interceptor of server

* Optimize interceptor unittest

* Optimize interceptor

* interceptor return quickly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants