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 Math; 20 21/** 22 */ 23class MathClient extends \Grpc\BaseStub { 24 25 /** 26 * @param string $hostname hostname 27 * @param array $opts channel options 28 * @param \Grpc\Channel $channel (optional) re-use channel object 29 */ 30 public function __construct($hostname, $opts, $channel = null) { 31 parent::__construct($hostname, $opts, $channel); 32 } 33 34 /** 35 * Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 36 * and remainder. 37 * @param \Math\DivArgs $argument input argument 38 * @param array $metadata metadata 39 * @param array $options call options 40 * @return \Grpc\UnaryCall 41 */ 42 public function Div(\Math\DivArgs $argument, 43 $metadata = [], $options = []) { 44 return $this->_simpleRequest('/math.Math/Div', 45 $argument, 46 ['\Math\DivReply', 'decode'], 47 $metadata, $options); 48 } 49 50 /** 51 * DivMany accepts an arbitrary number of division args from the client stream 52 * and sends back the results in the reply stream. The stream continues until 53 * the client closes its end; the server does the same after sending all the 54 * replies. The stream ends immediately if either end aborts. 55 * @param array $metadata metadata 56 * @param array $options call options 57 * @return \Grpc\BidiStreamingCall 58 */ 59 public function DivMany($metadata = [], $options = []) { 60 return $this->_bidiRequest('/math.Math/DivMany', 61 ['\Math\DivReply','decode'], 62 $metadata, $options); 63 } 64 65 /** 66 * Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib 67 * generates up to limit numbers; otherwise it continues until the call is 68 * canceled. Unlike Fib above, Fib has no final FibReply. 69 * @param \Math\FibArgs $argument input argument 70 * @param array $metadata metadata 71 * @param array $options call options 72 * @return \Grpc\ServerStreamingCall 73 */ 74 public function Fib(\Math\FibArgs $argument, 75 $metadata = [], $options = []) { 76 return $this->_serverStreamRequest('/math.Math/Fib', 77 $argument, 78 ['\Math\Num', 'decode'], 79 $metadata, $options); 80 } 81 82 /** 83 * Sum sums a stream of numbers, returning the final result once the stream 84 * is closed. 85 * @param array $metadata metadata 86 * @param array $options call options 87 * @return \Grpc\ClientStreamingCall 88 */ 89 public function Sum($metadata = [], $options = []) { 90 return $this->_clientStreamRequest('/math.Math/Sum', 91 ['\Math\Num','decode'], 92 $metadata, $options); 93 } 94 95} 96