Skip to content

Expose OrchestratorServiceStubs #1057

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

Spikhalskiy
Copy link
Contributor

What was changed

WorkflowServiceStubsImpl was refactored to reduce code duplication

Why?

Allow users to register search attributes using sdk
Refactoring of WorkflowServiceStubs to reduce code duplication

Closes #882

@Spikhalskiy Spikhalskiy force-pushed the issue-882 branch 19 times, most recently from c2c7a07 to b945e10 Compare March 6, 2022 19:42
@Spikhalskiy Spikhalskiy changed the title Providing OrchestratorServiceStubs Expose OrchestratorServiceStubs Mar 6, 2022
@Spikhalskiy Spikhalskiy marked this pull request as ready for review March 6, 2022 19:53
@Spikhalskiy Spikhalskiy force-pushed the issue-882 branch 2 times, most recently from cb97813 to ba39824 Compare March 6, 2022 20:28
this.channel = options.getChannel();
this.grpcConnectionManager = null;
} else {
this.channel = prepareChannel();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To confirm, by default we are intentionally creating separate channels for different gRPC services on the same server? I haven't put in thought to how the API would look if you wanted to share them, but I just want to make sure that is intentional.

Copy link
Contributor Author

@Spikhalskiy Spikhalskiy Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. By default, every Stubs creates its own channel. It happens now if we create several WorkflowServiceStubs too. At the same time, if the users really want, they can reuse the channel. I exposed ServiceStubs#getRawChannel and the channel can be taken from the existing stubs and reused in the Options for a new stub.

Also, keep in mind that a regular App shouldn't be creating OperatorServiceStubs at all.

@Spikhalskiy Spikhalskiy force-pushed the issue-882 branch 4 times, most recently from 26704b8 to 22a01ed Compare March 7, 2022 20:48
@Spikhalskiy Spikhalskiy force-pushed the issue-882 branch 2 times, most recently from a070874 to afb5f01 Compare March 7, 2022 22:52
Allow users to register search attributes using sdk
Refactoring of WorkflowServiceStubs to reduce code duplication
Issue temporalio#882
@Spikhalskiy Spikhalskiy merged commit 4678ae4 into temporalio:master Mar 7, 2022
@Spikhalskiy Spikhalskiy deleted the issue-882 branch March 8, 2022 01:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to register new search attributes
2 participants