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

server streaming in twirp #231

Closed
amit-vickey5 opened this issue Apr 27, 2020 · 1 comment
Closed

server streaming in twirp #231

amit-vickey5 opened this issue Apr 27, 2020 · 1 comment

Comments

@amit-vickey5
Copy link

amit-vickey5 commented Apr 27, 2020

I have a use case where the client sends a list of Image URLs along with a parameter "sync" or "async". In case of sync, the server is supposed to read all the URLs, and send the images to the client and at the end send a response stating "Downloaded successfully". Whereas in case of async, server is immediately supposed to send a response stating "Downloading Images" and send the images asynchronously.
I'm new to twirp, and not sure on how this can be implemented(as this seems to be server streaming problem).
Also, as of now, I have implemented sync functionality by using byte array, but the issue is I'm sending all the bytes of all the images at once. But it will be better to send the data in chunks(which again makes it a server streaming problem). How to achieve this as well?

@dpolansky
Copy link
Contributor

This is a duplicate of #70

It's unlikely that the streaming proposal will be released in Twirp. Without knowing more about the exact requirements you have for your system, it's difficult to determine whether an async API is actually ideal. One drawback that you might encounter is that the workload for that single request is fulfilled by the single server that receives that request. In contrast, if the caller could send batches of requests to many servers with a portion of the total request, a synchronous approach might be a better fit and may have ideal scaling characteristics across a fleet of servers.

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