Skip to content
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

cache grpc services #799

Conversation

Assem-Hafez
Copy link
Contributor

Summary

Cache grpc services so that they are not created on each request. This helps avoid high memory consumption as they are heavy objects.

Changes

  • Added global cache for cluster services
  • Moved Global ref to utils root to be used in grpc too
  • add default value for GlobalRef

metadata: c.grpc.metadata,
};
// cache services instances
const clisterServicesMapGlobalRef = new GlobalRef<ClustersServices>(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const clisterServicesMapGlobalRef = new GlobalRef<ClustersServices>(
const clusterServicesMapGlobalRef = new GlobalRef<ClustersServices>(

return services;
};

const getClustersServices = async () => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: Would suggest renaming this to getAllClustersServices or something similar just for clarity.

@Assem-Uber Assem-Uber merged commit 8b27d83 into cadence-workflow:release/4.0.0 Jan 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants