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

support streaming responses in request-response protocol #1942

Closed
dvc94ch opened this issue Jan 28, 2021 · 2 comments
Closed

support streaming responses in request-response protocol #1942

dvc94ch opened this issue Jan 28, 2021 · 2 comments

Comments

@dvc94ch
Copy link
Contributor

dvc94ch commented Jan 28, 2021

currently if a request results in multiple responses you can't use the request-response protocol. I wonder how hard it would be to add a final_response method to the request response behaviour and keeping the channel open until the final response.

@romanb
Copy link
Contributor

romanb commented Feb 4, 2021

My first impulse would be to have a dedicated crate for generic streaming-oriented protocols, where any number of "chunks" can be sent in either direction on a single substream. libp2p-request-response is really designed for RPC-like "1-request, 1-response" protocols and bending it to serve different needs may be too cumbersome and restrictive on what you can do. But this is just my "gut feeling" without having made a proper analysis or experiment with the necessary changes. This may be a duplicate of #1727.

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Feb 4, 2021

Closing as a duplicate for now, but many rpc api's support some kind of pubsub and it would be nice to reuse the underlying stream instead of opening a new one for each notification.

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