spiral-modules / php-grpc

:electric_plug: Fast and furious GRPC server for PHP applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run services with splitted proto files ?

eoempat opened this issue · comments

Hi, great job with this project.

I am new to gRPC and i am wondering how to run services with splitted proto files ? Here is the case.

  • services
    • services_a.proto
    • services_b.proto

How i can register both services_a and services_b at ".rr" config file since it need single proto file to be registered to server ?

You can use the default import functionality. This the example: https://github.com/spiral/php-grpc/blob/master/cmd/protoc-gen-php-grpc/testdata/import_custom/service.proto#L7

My case is i need to register multiple services that defined with multiple proto files. I tried to use import public to forward all the imports but the imported services do not registered at server.

Currently, i can't find a way to do that. I think proto configuration should be able to receive array arguments. Are there any affected work flow if the server can register multiple proto files ? May be i can provide a PR.

Thank you.

There are not affected flow, well, except that we still have to support single config file notation. Your PR is welcomed.

Okay then.
I'll make a PR regarding this discussion and i'll close this issue.

Thank you.