setStatus(\Grpc\Status::unimplemented()); return null; } /** * Sets a return status for pending and upcoming calls to Hook * @param \Grpc\Testing\SetReturnStatusRequest $request client request * @param \Grpc\ServerContext $context server request context * @return \Grpc\Testing\EmptyMessage for response data, null if if error occured * initial metadata (if any) and status (if not ok) should be set to $context */ public function SetReturnStatus( \Grpc\Testing\SetReturnStatusRequest $request, \Grpc\ServerContext $context ): ?\Grpc\Testing\EmptyMessage { $context->setStatus(\Grpc\Status::unimplemented()); return null; } /** * Clears the return status. Incoming calls to Hook will "hang" * @param \Grpc\Testing\EmptyMessage $request client request * @param \Grpc\ServerContext $context server request context * @return \Grpc\Testing\EmptyMessage for response data, null if if error occured * initial metadata (if any) and status (if not ok) should be set to $context */ public function ClearReturnStatus( \Grpc\Testing\EmptyMessage $request, \Grpc\ServerContext $context ): ?\Grpc\Testing\EmptyMessage { $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 [ '/grpc.testing.HookService/Hook' => new \Grpc\MethodDescriptor( $this, 'Hook', '\Grpc\Testing\EmptyMessage', \Grpc\MethodDescriptor::UNARY_CALL ), '/grpc.testing.HookService/SetReturnStatus' => new \Grpc\MethodDescriptor( $this, 'SetReturnStatus', '\Grpc\Testing\SetReturnStatusRequest', \Grpc\MethodDescriptor::UNARY_CALL ), '/grpc.testing.HookService/ClearReturnStatus' => new \Grpc\MethodDescriptor( $this, 'ClearReturnStatus', '\Grpc\Testing\EmptyMessage', \Grpc\MethodDescriptor::UNARY_CALL ), ]; } }