Last active
August 18, 2021 04:54
-
-
Save daneshk/1479e4f199191edf8298e438a94fd75b to your computer and use it in GitHub Desktop.
This file contains 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
RouteGuideClient ep = check new ("http://localhost:8980"); | |
// Client streaming | |
Point[] points = [ | |
{latitude: 406109563, longitude: -742186778}, | |
{latitude: 411733222, longitude: -744228360} | |
]; | |
RecordRouteStreamingClient recordRouteStrmClient = check ep->RecordRoute(); | |
foreach Point p in points { | |
check recordRouteStrmClient->sendPoint(p); | |
} | |
check recordRouteStrmClient->complete(); | |
RouteSummary? routeSummary = check recordRouteStrmClient->receiveRouteSummary(); | |
if routeSummary is RouteSummary { | |
io:println(`Finished trip with ${routeSummary.point_count} points. Passed ${routeSummary.feature_count} features. "Travelled ${routeSummary.distance} meters. It took ${routeSummary.elapsed_time} seconds.`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment