Skip to content

Instantly share code, notes, and snippets.

@daneshk
Last active August 18, 2021 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daneshk/1479e4f199191edf8298e438a94fd75b to your computer and use it in GitHub Desktop.
Save daneshk/1479e4f199191edf8298e438a94fd75b to your computer and use it in GitHub Desktop.
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