-
Notifications
You must be signed in to change notification settings - Fork 5
New RPC System without the var renames #1145
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
base: dev
Are you sure you want to change the base?
Conversation
…lueprint to be consistent with docs
Greptile OverviewGreptile SummaryImplements a new RPC system with module references and Spec-based dependency injection. This PR introduces:
Key changes:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant autoconnect
participant ModuleBlueprintSet
participant ModuleCoordinator
participant Calculator as Calculator Module
participant Client as Client Module
participant RPCClient as ModuleProxy
User->>autoconnect: autoconnect(Calculator.blueprint(), Client.blueprint())
autoconnect->>ModuleBlueprintSet: Create blueprints with module_refs
Note over ModuleBlueprintSet: Extract StreamRefs (In/Out)<br/>Extract ModuleRefs (Spec/Module annotations)
User->>ModuleBlueprintSet: .build()
ModuleBlueprintSet->>ModuleCoordinator: start()
ModuleBlueprintSet->>ModuleCoordinator: _deploy_all_modules()
ModuleCoordinator->>Calculator: Deploy module
ModuleCoordinator->>RPCClient: Wrap in RPCClient (ModuleProxy)
ModuleCoordinator->>Client: Deploy module
ModuleCoordinator->>RPCClient: Wrap in RPCClient (ModuleProxy)
ModuleBlueprintSet->>ModuleBlueprintSet: _connect_transports()
Note over ModuleBlueprintSet: Connect In/Out streams via LCMTransport
ModuleBlueprintSet->>ModuleBlueprintSet: _connect_rpc_methods()
Note over ModuleBlueprintSet: Register RPC methods for discovery
ModuleBlueprintSet->>ModuleBlueprintSet: _connect_module_refs()
Note over ModuleBlueprintSet: Match Client.calc (ComputeSpec)<br/>to Calculator module
ModuleBlueprintSet->>Client: set_module_ref("calc", calculator_proxy)
Note over Client: Client.calc now references Calculator
ModuleBlueprintSet->>ModuleCoordinator: start_all_modules()
Client->>Calculator: self.calc.compute1(2, 3) via RPC
Calculator-->>Client: Return 5
Client->>Calculator: self.calc.compute2(1.5, 2.5) via RPC
Calculator-->>Client: Return 4.0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 1 comment
| mod_and_mod_ref_to_proxy = { | ||
| (module, name): replacement | ||
| for (module, name), replacement in self.remapping_map.items() | ||
| if is_spec(replacement) or issubclass(replacement, Module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling issubclass(replacement, Module) will raise TypeError when replacement is a string (which is allowed by the type hint str | type[Module] on line 114)
| if is_spec(replacement) or issubclass(replacement, Module) | |
| if is_spec(replacement) or (isinstance(replacement, type) and issubclass(replacement, Module)) |
Unlike jeff/blueprint/6 the undo-rename wasn't tested (yet)