MailboxRPC 4/7: mailboxrpc ServeMux router - #88
Conversation
Summary of ChangesHello @bhandras, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a core routing mechanism within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a ServeMux implementation for mailboxrpc, providing a minimal, in-process router for RPC method dispatch. The code is well-structured and includes initial tests for dispatching and handling missing routes. My review focuses on improving the robustness of the API by adding validation for handler registration and enhancing the maintainability and style of the test code. Overall, this is a solid addition that provides a useful building block for the server side.
61852eb to
05d1378
Compare
d4f03e7 to
e4343d5
Compare
05d1378 to
47ea49d
Compare
47ea49d to
2eed94b
Compare
aade4ce to
7f50436
Compare
2eed94b to
310e2ef
Compare
7f50436 to
9890890
Compare
b86eb67 to
689ba4f
Compare
9890890 to
8166d7c
Compare
689ba4f to
a3049b3
Compare
|
@codex review pls |
|
To use Codex here, create a Codex account and connect to github. |
|
@bhandras, remember to re-request review from reviewers when ready |
8166d7c to
06821ef
Compare
a3049b3 to
b090a9b
Compare
| return nil, fmt.Errorf("nil request prototype for %s/%s", | ||
| service, method) | ||
| } | ||
|
|
There was a problem hiding this comment.
Would've maybe thought that we do a message send here after looking up a service key?
There was a problem hiding this comment.
Ah I guess that's the role of the handler that's registered?
|
@claude review this |
|
@codex review this |
|
Claude finished @Roasbeef's task in 1m 39s —— View job Code Review CompleteI've reviewed the Strengths
Issues Found1. Missing GoDoc comments for unexported typesSeverity: Medium | Location: Per the development guidelines, every function and method (including unexported ones) must have a comment. The unexported types Current: type routeKey struct {
service string
method string
}
type handlerEntry struct {
newReq func() proto.Message
fn HandlerFunc
}Should be: // routeKey uniquely identifies an RPC endpoint by its (service, method) pair.
type routeKey struct {
service string
method string
}
// handlerEntry bundles the request constructor and handler function for a
// registered RPC method.
type handlerEntry struct {
newReq func() proto.Message
fn HandlerFunc
}2. Unexported
|
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds
mailboxrpc.ServeMux: a small in-process router implementation that:mailboxrpc.Router.ServeRPCto unmarshal binary protobuf requests and dispatch to theregistered handler.
Motivation
This gives the server side a minimal, dependency-free building block for RPC
method dispatch while higher-level mailbox transport concerns (durability,
ack/cursor handling, auth) are developed.
References