Draft
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refines the gRPC product page example by introducing a thread‐safe caching mechanism with TTL, refining asynchronous data fetching with Concurrent::Promises, and updating documentation.
- Introduces a Liquid template for rendering product pages
- Implements concurrent data fetching with a thread-safe cache in product_page.rb
- Updates the README to document the new example
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| example/grpc_ecommerce/templates/product_page.liquid | Adds a new HTML template for the product page |
| example/grpc_ecommerce/product_page.rb | Implements async gRPC fetches and caching logic |
| example/grpc_ecommerce/README.md | Documents the updated gRPC ecommerce example |
|
|
||
| DemoProduct = Struct.new(:name, :description, :price, keyword_init: true) | ||
| DemoCategory = Struct.new(:name, keyword_init: true) | ||
| ProductRequest = Struct.new(:id) |
There was a problem hiding this comment.
Consider adding keyword_init: true to the ProductRequest struct definition to support the keyword argument usage in 'ProductRequest.new(id: id)'.
| DemoCategory = Struct.new(:name, keyword_init: true) | ||
| ProductRequest = Struct.new(:id) | ||
| Empty = Struct.new(:dummy) | ||
| RecommendationsRequest = Struct.new(:product_id) |
There was a problem hiding this comment.
Consider adding keyword_init: true to the RecommendationsRequest struct to allow keyword argument construction with 'RecommendationsRequest.new(product_id: id)'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Testing
bundle exec rakebundle exec rubocop example/grpc_ecommerce/product_page.rb