1<?php 2// GENERATED CODE -- DO NOT EDIT! 3 4// Original file comments: 5// Copyright 2015 gRPC authors. 6// 7// Licensed under the Apache License, Version 2.0 (the "License"); 8// you may not use this file except in compliance with the License. 9// You may obtain a copy of the License at 10// 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// See the License for the specific language governing permissions and 17// limitations under the License. 18// 19namespace Routeguide; 20 21/** 22 * Interface exported by the server. 23 */ 24class RouteGuideClient extends \Grpc\BaseStub { 25 26 /** 27 * @param string $hostname hostname 28 * @param array $opts channel options 29 * @param \Grpc\Channel $channel (optional) re-use channel object 30 */ 31 public function __construct($hostname, $opts, $channel = null) { 32 parent::__construct($hostname, $opts, $channel); 33 } 34 35 /** 36 * A simple RPC. 37 * 38 * Obtains the feature at a given position. 39 * 40 * A feature with an empty name is returned if there's no feature at the given 41 * position. 42 * @param \Routeguide\Point $argument input argument 43 * @param array $metadata metadata 44 * @param array $options call options 45 * @return \Grpc\UnaryCall 46 */ 47 public function GetFeature(\Routeguide\Point $argument, 48 $metadata = [], $options = []) { 49 return $this->_simpleRequest('/routeguide.RouteGuide/GetFeature', 50 $argument, 51 ['\Routeguide\Feature', 'decode'], 52 $metadata, $options); 53 } 54 55 /** 56 * A server-to-client streaming RPC. 57 * 58 * Obtains the Features available within the given Rectangle. Results are 59 * streamed rather than returned at once (e.g. in a response message with a 60 * repeated field), as the rectangle may cover a large area and contain a 61 * huge number of features. 62 * @param \Routeguide\Rectangle $argument input argument 63 * @param array $metadata metadata 64 * @param array $options call options 65 * @return \Grpc\ServerStreamingCall 66 */ 67 public function ListFeatures(\Routeguide\Rectangle $argument, 68 $metadata = [], $options = []) { 69 return $this->_serverStreamRequest('/routeguide.RouteGuide/ListFeatures', 70 $argument, 71 ['\Routeguide\Feature', 'decode'], 72 $metadata, $options); 73 } 74 75 /** 76 * A client-to-server streaming RPC. 77 * 78 * Accepts a stream of Points on a route being traversed, returning a 79 * RouteSummary when traversal is completed. 80 * @param array $metadata metadata 81 * @param array $options call options 82 * @return \Grpc\ClientStreamingCall 83 */ 84 public function RecordRoute($metadata = [], $options = []) { 85 return $this->_clientStreamRequest('/routeguide.RouteGuide/RecordRoute', 86 ['\Routeguide\RouteSummary','decode'], 87 $metadata, $options); 88 } 89 90 /** 91 * A Bidirectional streaming RPC. 92 * 93 * Accepts a stream of RouteNotes sent while a route is being traversed, 94 * while receiving other RouteNotes (e.g. from other users). 95 * @param array $metadata metadata 96 * @param array $options call options 97 * @return \Grpc\BidiStreamingCall 98 */ 99 public function RouteChat($metadata = [], $options = []) { 100 return $this->_bidiRequest('/routeguide.RouteGuide/RouteChat', 101 ['\Routeguide\RouteNote','decode'], 102 $metadata, $options); 103 } 104 105} 106