Skip to content

feat(api): add generic server-side method traits for codegen - #3

Open
sauravzg wants to merge 1 commit into
streamfrom
method_handler_codegen_api
Open

feat(api): add generic server-side method traits for codegen#3
sauravzg wants to merge 1 commit into
streamfrom
method_handler_codegen_api

Conversation

@sauravzg

Copy link
Copy Markdown
Owner

No description provided.

@sauravzg

Copy link
Copy Markdown
Owner Author

This PR is part of a stack of 13 bookmarks:

  1. trunk()
  2. grpc_message_traits
  3. stream
  4. method_handler_codegen_api ← this PR
  5. call_objects
  6. internal_method_handlers
  7. codec
  8. codec_handlers
  9. interceptor_api
  10. dyn_byte_stream_handlers
  11. transport_interface
  12. rpc_router
  13. server_api
  14. hyper_transport_implementation

Created with jj-stack

Introduce the public API traits for server-side gRPC methods (`UnaryMethod`, `ClientStreamingMethod`, `ServerStreamingMethod`, `BidiStreamingMethod`).
These traits are designed to be the primary interface for codegen.

Currently, the API models a handler as an async function with a (requeststream, responsesink) interface.

Note on design:
- The public API is scoped to access request and response messages only.
- Modifications to headers and trailers are intended to be handled via "interceptor" APIs, following the Java gRPC model.
- Contextual information is expected to be accessed via a read-only local context.

Known pitfalls:
- Unary inputs are references, implying that they will not trivially work with spawns. While responses can be shallow copied due to them being mut refs, requests will have to be copied if they need to be sent to a different task.
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