Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple different gRPC services on the same port/endpoint? #120

Open
tim2CF opened this issue Mar 29, 2021 · 2 comments
Open

Running multiple different gRPC services on the same port/endpoint? #120

tim2CF opened this issue Mar 29, 2021 · 2 comments

Comments

@tim2CF
Copy link

tim2CF commented Mar 29, 2021

Is it possible? Any examples?

@Gabriella439
Copy link
Contributor

@tim2CF: It is possible, albeit very awkward using the current API. The way you could do it in theory is to essentially implement something similar to the code that is generated by compile-proto-file for running a server.

Specifically, when you create a service named Foo, then compile-proto-file will generate a fooServer :: Foo ServerRequest ServerResponse -> ServiceOptions -> IO () that unpacks the service methods and repacks them into the server handlers to run a server on a single port. You could similar unpack the methods of multiple services and pack them into the handlers for a server in the same way as the generated code, but it would not be very ergonomic.

@tim2CF
Copy link
Author

tim2CF commented Mar 30, 2021

Thanks for reply, @Gabriel439
It's not critical issue at the moment, but in the future it will be very handy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants