-
Notifications
You must be signed in to change notification settings - Fork 5
RPC Rework: Part 4: Create ModuleRef #1141
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
…o jeff/blueprint/3
Greptile OverviewGreptile SummaryThis PR implements Part 4 of the RPC Rework by introducing
The refactoring improves naming clarity ( Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Module as Module Class
participant Blueprint as Blueprint.create()
participant Atom as _BlueprintAtom.create()
participant SpecUtils as spec/utils
participant ModuleRef as ModuleRef
User->>Module: Call Module.blueprint(*args, **kwargs)
Module->>Blueprint: Blueprint.create(Module, args, kwargs)
Blueprint->>Atom: _BlueprintAtom.create(Module, args, kwargs)
Note over Atom: Iterate through module annotations
Atom->>Atom: Check if annotation is In/Out
alt Stream annotation (In/Out)
Atom->>Atom: Create StreamRef(name, type, direction)
else Spec Protocol annotation
Atom->>SpecUtils: is_spec(annotation)
SpecUtils-->>Atom: True
Atom->>SpecUtils: get_protocol_method_signatures(annotation)
SpecUtils-->>Atom: Return method signatures
Atom->>ModuleRef: Create ModuleRef(name, rpc_method_names)
else Module instance annotation
Atom->>Atom: Check isinstance(getattr(module, name), Module)
Atom->>ModuleRef: Create ModuleRef(name, other_module.rpc_calls)
end
Atom-->>Blueprint: Return _BlueprintAtom(module, connections, module_refs, args, kwargs)
Blueprint-->>Module: Return Blueprint(blueprints=(atom,))
Module-->>User: Return Blueprint
|
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.
1 file reviewed, 1 comment
| elif isinstance(getattr(module, name, None), Module): | ||
| other_module = getattr(module, name) | ||
| module_refs.append(ModuleRef(name=name, rpc_method_names=other_module.rpc_calls)) |
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.
Consider if this Module instance check pattern is needed - no examples exist in the codebase where Module instances are used as class attributes.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.