Skip to content

Add unified method handlers for server-side - #5

Open
sauravzg wants to merge 1 commit into
call_objectsfrom
internal_method_handlers
Open

Add unified method handlers for server-side#5
sauravzg wants to merge 1 commit into
call_objectsfrom
internal_method_handlers

Conversation

@sauravzg

Copy link
Copy Markdown
Owner

No description provided.

@sauravzg

Copy link
Copy Markdown
Owner Author

…r handling all types of gRPC methods on the server side, along with adapters for specific method types.

Key changes:
- Introduce `StreamingMethodHandler` trait to provide a common interface for method execution.
- Add `UnaryMethodAdapter`, `ServerStreamingAdapter`, `ClientStreamingAdapter`, and `BidiStreamingAdapter` to bridge specific method traits to the unified handler.
- This generic API has intentionally been kept private due to the pitfalls below.


Known pitfalls:
- Lazy and ResponseHolder are not very great abstractions to workaround the fact that we may not always have ownership of the underlying message.
- Asymmetry between the API: Request is lazy while response is in a holder.
- The API is very generic heavy, but this should be acceptable at least until we talk about interceptors. C++ has a similar setup with Generic handler until being type erased in the codec layer.
@sauravzg
sauravzg force-pushed the internal_method_handlers branch from c9a9a2b to 1bdcc41 Compare March 6, 2026 15:15
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