Grpc-XS
view release on metacpan or search on metacpan
t/01-call_credentials.t
t/02-call.t
t/03-channel_credentials.t
t/04-channel.t
t/05-constants.t
t/06-server_credentials.t
t/07-server.t
t/08-timeval.t
t/09-abstract_call.t
t/10-base_stub.t
t/11-bidi_streaming_call.t
t/12-client_streaming_call.t
t/13-server_streaming_call.t
t/14-unary_call.t
t/15-xs_end_to_end.t
t/16-xs_secure_end_to_end.t
t/17-fork_friendliness.t
t/data/ca.pem
t/data/README
t/data/server1.key
t/data/server1.pem
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
examples/route_guide/route_guide.proto view on Meta::CPAN
package routeguide;
// Interface exported by the server.
service RouteGuide {
// A simple RPC.
//
// Obtains the feature at a given position.
rpc GetFeature(Point) returns (Feature) {}
// A server-to-client streaming RPC.
//
// Obtains the Features available within the given Rectangle. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field), as the rectangle may cover a large area and contain a
// huge number of features.
rpc ListFeatures(Rectangle) returns (stream Feature) {}
// A client-to-server streaming RPC.
//
// Accepts a stream of Points on a route being traversed, returning a
// RouteSummary when traversal is completed.
rpc RecordRoute(stream Point) returns (RouteSummary) {}
// A Bidirectional streaming RPC.
//
// Accepts a stream of RouteNotes sent while a route is being traversed,
// while receiving other RouteNotes (e.g. from other users).
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
}
// Points are represented as latitude-longitude pairs in the E7 representation
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive).
examples/route_guide/t/02-list_features.t view on Meta::CPAN
latitude => 420000000,
longitude => -730000000,
});
my $rectangle = new ProtobufXS::routeguide::Rectangle({
lo => $lo_point,
hi => $hi_point,
});
my $call = $client->ListFeatures(argument => $rectangle);
## an iterator over the server streaming responses
my @features = $call->responses();
foreach my $feature (@features) {
print STDERR Dumper($feature);
#printFeature($feature);
}
ok(@features,"no features returned by server");
examples/route_guide/t/03-record_route.t view on Meta::CPAN
## recordRoute ##
#################
# Run the recordRoute demo. Sends several randomly chosen points from the
# pre-generated feature database with a variable delay in between. Prints
# the statistics when they are sent from the server.
my $client = new ProtobufXS::routeguide::Service::RouteGuide('localhost:10000',
credentials => undef );
## start the client streaming call
my $call = $client->RecordRoute();
my @db = readRouteDbFile();
my $num_points_in_db = scalar(@db);
my $num_points = 10;
for (my $i = 0; $i < $num_points; $i++) {
my $point = new ProtobufXS::routeguide::Point();
my $index = rand($num_points_in_db);
my $lat = $db[$index]->{latitude};
my $long = $db[$index]->{longitude};
$point->set_latitude($lat);
lib/Grpc/Client/BaseStub.pm view on Meta::CPAN
if (defined($self->{_update_metadata})) {
$metadata = $self->{_update_metadata}($metadata,$jwt_aud_uri); ## TODO: PORT
}
$metadata = $self->_validate_and_normalize_metadata($metadata);
$call->start($argument, $metadata, $options);
return $call;
}
## Call a remote method with messages streaming in both directions.
##
## @param string $method The name of the method to call
## @param callable $serialize A function that serializes the request
## @param callable $deserialize A function that deserializes the responses
## @param array $metadata A metadata map to send to the server
##
## @return BidiStreamingSurfaceActiveCall The active call object
sub _bidiRequest {
my $self = shift;
( run in 0.259 second using v1.01-cache-2.11-cpan-4d50c553e7e )