RouteGuideClient.php 3.5 KB

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