Bluehouse-Technology / grpc

Erlang library for GRPC
Apache License 2.0
100 stars 38 forks source link

Multiple service handlers #8

Closed tsloughter closed 6 years ago

tsloughter commented 7 years ago

I'm working on some changes and wanted to run the changes by you before getting to far.

The issue I was dealing with was wanting to host multiple services handled by different modules from the same server port. Currently the grpc app only accepts 1 module name.

Here is the example converted to what I'm thinking:

> {ok, Server} = grpc:start_server(grpc, tcp, 10000, [#{service => route_guide,
                                                        defs_module => route_guide,
                                                        handler => route_guide_server_1}]).

This would also remove the need for the function decoder() -> route_guide.

willemdj commented 7 years ago

Yes, you are right, sounds like a good idea.

willemdj commented 6 years ago

I implemented something very similar to what you proposed, thanks for the suggestion.