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

Using as a GRPC server #20

Closed
slashmili opened this issue Aug 2, 2022 · 3 comments
Closed

Using as a GRPC server #20

slashmili opened this issue Aug 2, 2022 · 3 comments

Comments

@slashmili
Copy link

Hey 👋🏼

I've been looking for a HTTP 2.0 server that I can use to build a GRPC server. I'm wondering if it's something that you have looked into?

For unary calls the way that Plug works is good enough. request comes and the server serves it.

However for server-streaming something like a genserver is optimal. What I mean is somehow making a request on a route, spawn a genserver and until the process decides that there is no more data need to be transferred.

Any suggestions or thoughts?

@mtrudel
Copy link
Owner

mtrudel commented Aug 2, 2022

Hi!

This has been discussed previously at #17; the tl;dr is that Bandit's mandate is to be a Plug (and shortly Sock!) server first and foremost. To the extent that it would be able to serve streaming gRPC clients, I would suggest that those changes be proposed & adopted via the Plug API / project. If the community were able to agree on a standard for this there (which I think is needed, btw), I'd happily implement support for it within Bandit.

I'll also note that this is a thing which would be generally useful beyond gRPC; indeed the project that originally spurred Bandit's development does its own cheap hack to do something similar. It's a generally useful improvement, to be sure, just one that needs to be agreed on elsewhere.

@mtrudel mtrudel closed this as completed Aug 2, 2022
@mtrudel
Copy link
Owner

mtrudel commented Aug 2, 2022

I'll also note that the Bandit process which calls Plugs (at least in the HTTP/1 case) is a GenServer, and if you were so inclined you could hack support for server-initiated messages in mostly cleanly (albeit in a manner totally separate from the Plug API). See the link in my previous comment for prior art.

@slashmili
Copy link
Author

Thanks for the quick reply! I'm sorry for not searching before creating the issue. I have kept my eyes on this project for over 1 year. Somehow I missed #17 conversation!

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