Generate RPC calls in Bridge Client #1123
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was changed
This PR adds code generation of the RPC call wrapper in the bridge client to ensure ease the maintenance of manually updating the methods when core has a proto update. This generation has been added to the end of the
gen_protos_docker
script.Some changes were included to make the generation possible:
rpc_call
andrpc_call_on_trait
macros have been refactored to only include an exported macro namedrpc_call
that uses the fully qualified call syntax that was previously in the body ofrpc_call_on_trait
.multiple-pymethods
feature of PyO3 was enabled to allow theClientRef
impl to be split into two modules.client
module was elevated topub(crate)
for referencing from theclient_rpc_generated
module.Why?
This allows us to easily keep the bridge client up to date with the RPC methods exposed via core.
Checklist
Closes [Bug] Batch operation feature in the Temporal Python SDK doesn't work #927
How was this tested:
The generated client was tested against the existing test suite and used to ensure the repro described in #927 correctly functions against a Temporal dev server.