You can check this section https://grpc.io/docs/languages/php/quickstart/#php-protoc-plugin in the grpc.io website to see how you can use the PHP grpc plugin to generate a stub client from your proto.
On Thu, Oct 29, 2020 at 5:54 PM '[email protected]' via grpc.io < [email protected]> wrote: > Hi, > I am hoping to find any information on how I can create a simple > Healthcheck client in php against the internally defined proto ( > https://github.com/grpc/grpc/blob/master/src/proto/grpc/health/v1/health.proto > ). > We already have a working environment for gRPC clients using the model and > libs defined here : https://github.com/grpc/grpc-php. However I am not > certain if there is a documented way to either generate the protos defined > in io/grpc or use them as is in php. > To further clarify, > I am hoping to do some thing like the below snippet in PHP > > > > > > > > > > > > > > > > > > > > > *import io.grpc.health.v1.HealthCheckRequest;import > io.grpc.health.v1.HealthCheckResponse;import > io.grpc.health.v1.HealthGrpc;import io.grpc.ManagedChannel;import > io.grpc.ManagedChannelBuilder;public class HealthcheckImplClient { > public static void main(String[] args) { ManagedChannel ch = > ManagedChannelBuilder.forAddress("localhost", 8012) .usePlaintext() > .build(); HealthGrpc.HealthBlockingStub hclient = > HealthGrpc.newBlockingStub(ch); HealthCheckRequest req = > HealthCheckRequest.newBuilder().build(); HealthCheckResponse resp = > hclient.check(req); System.out.println(resp.getStatus()); ch.shutdown(); > }}* > > Appreciate any help regarding this. > > > Thanks, > Deepak > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/c6e514f1-3aba-446e-871d-fb587c4569d4n%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/c6e514f1-3aba-446e-871d-fb587c4569d4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAEteGX0Cp3%3Dnkapwtqv1_OFpNquHAJSddzyxnOFECg%2BcYpMhOQ%40mail.gmail.com.
