-
Notifications
You must be signed in to change notification settings - Fork 16
Fix Route Guide tutorial compilation errors and implementation issues #32
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
Conversation
Remove .message accessor from request.latitude and request.longitude across unary, server streaming, and client streaming examples.
Motivation: The Notes class was referenced but not implemented in the Route Guide tutorial step 10. This adds the missing thread-safe Notes class that stores RouteNote messages. Modifications: - Added Notes class with Mutex for thread-safe storage of RouteNote messages - Added recordNote method to store notes and return notes from the same location - Added receivedNotes property to RouteGuideService Result: The Notes class is now properly implemented, allowing the routeChat method to store and retrieve notes in a thread-safe manner.
Step 7 was skipped in the original sequence. This fixes the step numbering to be sequential without gaps.
Client is generic and cannot be used directly in method signatures. Use ClientProtocol instead to fix compilation errors in tutorial examples.
glbrntt
left a comment
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.
This is great, thank you. I left one comment which needs resolving in multiple places.
...ocumentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec06-step06-get-feature.swift
Outdated
Show resolved
Hide resolved
… of the existential ClientProtocol type.
glbrntt
left a comment
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.
The formatter is unhappy now, running ./dev/format.sh should fix it
|
@glbrntt Thanks, the formatter is happy now!! |
glbrntt
left a comment
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.
Thank you for doing this!
Motivation:
Clienttype being used directly in method signatures, causing compilation errors.messageaccessorloadFeaturesbeing incorrectly defined as a private static method instead of an internal instance methodModifications:
ClienttoClientProtocolin method signatures across unary, server streaming, client streaming, and bidirectional streaming examples to fix generic type compilation issuesNotesclass withMutexfor storingRouteNotemessages, includingrecordNotemethod andreceivedNotesproperty inRouteGuideService.messageaccessor fromrequest.latitudeandrequest.longitudeacross all tutorial examples (unary, server streaming, client streaming)loadFeaturesfrom a static method to an instance method and changed its visibility from private to internal to make it accessible from extension filesResult:
The Route Guide tutorial now compiles successfully and provides complete, working examples for all four gRPC call types (unary, server streaming, client streaming, and bidirectional streaming).
Users can follow the tutorial from start to finish without encountering compilation errors or missing implementations.
A working sample implementation following this tutorial is available at https://github.com/mtfum/RouteGuide/.