Skip to content

drpcserver: add server interceptor support in drpc #7

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shaikzakiriitm
Copy link

@shaikzakiriitm shaikzakiriitm commented Jun 9, 2025

Added server interceptor support in drpc. Created the interface for server
interceptor and wired it into the server logic to be executed before actual
handler is executed.

Unlike grpc, here there is no separation between unary and stream
interceptors because the unerdlying logic of handling the rpc calls
is the same i.e. drpc.Handler's handleRPC implementation. In grpc,
we have separate processing for unary rpc's and stream rpc's. This
common processing for both stream and unary rpcs has helped condense
the interceptor interfaces into a single interface that works for both
use-cases, essentially simplifying the logic of initializing and
wiring of interceptors.

Fixes: #147622
Epic: CRDB-51168

Add support for server interceptors in drpc. Interceptors are taken as
server options, while instantiating the server. All interceptors
added via server options are chained into a single server interceptor.

Unlike grpc, here there is no separation between unary and stream
interceptors because the unerdlying logic of handling the rpc calls
is the same i.e. `drpc.Handler`'s `handleRPC` implementation. In grpc,
we have separate processing for unary rpc's and stream rpc's. This
common processing for both stream and unary rpcs has helped condense
the interceptor interfaces into a single interface that works for both
use-cases, essentially simplifying the logic of initializing and
wiring of interceptors.

Fixes: #147622
Epic: CRDB-51168
@shaikzakiriitm shaikzakiriitm marked this pull request as ready for review June 9, 2025 16:30
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.

1 participant