setStatus(\Grpc\Status::unimplemented()); return null; } /** * DivMany accepts an arbitrary number of division args from the client stream * and sends back the results in the reply stream. The stream continues until * the client closes its end; the server does the same after sending all the * replies. The stream ends immediately if either end aborts. * @param \Grpc\ServerCallReader $reader read client request data of \Math\DivArgs * @param \Grpc\ServerCallWriter $writer write response data of \Math\DivReply * @param \Grpc\ServerContext $context server request context * @return void */ public function DivMany( \Grpc\ServerCallReader $reader, \Grpc\ServerCallWriter $writer, \Grpc\ServerContext $context ): void { $context->setStatus(\Grpc\Status::unimplemented()); $writer->finish(); } /** * Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib * generates up to limit numbers; otherwise it continues until the call is * canceled. Unlike Fib above, Fib has no final FibReply. * @param \Math\FibArgs $request client request * @param \Grpc\ServerCallWriter $writer write response data of \Math\Num * @param \Grpc\ServerContext $context server request context * @return void */ public function Fib( \Math\FibArgs $request, \Grpc\ServerCallWriter $writer, \Grpc\ServerContext $context ): void { $context->setStatus(\Grpc\Status::unimplemented()); $writer->finish(); } /** * Sum sums a stream of numbers, returning the final result once the stream * is closed. * @param \Grpc\ServerCallReader $reader read client request data of \Math\Num * @param \Grpc\ServerContext $context server request context * @return \Math\Num for response data, null if if error occured * initial metadata (if any) and status (if not ok) should be set to $context */ public function Sum( \Grpc\ServerCallReader $reader, \Grpc\ServerContext $context ): ?\Math\Num { $context->setStatus(\Grpc\Status::unimplemented()); return null; } /** * Get the method descriptors of the service for server registration * * @return array of \Grpc\MethodDescriptor for the service methods */ public final function getMethodDescriptors(): array { return [ '/math.Math/Div' => new \Grpc\MethodDescriptor( $this, 'Div', '\Math\DivArgs', \Grpc\MethodDescriptor::UNARY_CALL ), '/math.Math/DivMany' => new \Grpc\MethodDescriptor( $this, 'DivMany', '\Math\DivArgs', \Grpc\MethodDescriptor::BIDI_STREAMING_CALL ), '/math.Math/Fib' => new \Grpc\MethodDescriptor( $this, 'Fib', '\Math\FibArgs', \Grpc\MethodDescriptor::SERVER_STREAMING_CALL ), '/math.Math/Sum' => new \Grpc\MethodDescriptor( $this, 'Sum', '\Math\Num', \Grpc\MethodDescriptor::CLIENT_STREAMING_CALL ), ]; } }