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

Feature Request: Support for RPC method with two stream requests and one stream response #37818

Open
jasseur2017 opened this issue Sep 29, 2024 · 0 comments

Comments

@jasseur2017
Copy link

Feature Request: Add RPC method with multiple stream requests and one stream response

Overview

I'm proposing a new feature that allows the definition of gRPC methods where the server accepts multiple independent stream requests (e.g., two or more) and processes these streams concurrently, returning a single stream response.

Motivation

Currently, gRPC supports bidirectional streaming, where both client and server can stream data. However, it is limited to one request stream and one response stream. For some use cases, it would be useful for the server to handle multiple concurrent request streams (from the same client) while sending back a unified or processed stream as the response.

Use Cases

  1. File transfer and processing: A client may stream two large files (or multiple files) concurrently to a server, which processes the data and streams back results in a single response stream.
  2. Multi-data source streaming: Scenarios where a client needs to stream data from two independent sources (or more) and the server performs real-time merging or processing on those streams, then responds with a single stream of results.
  3. Real-time collaboration applications: For applications requiring concurrent real-time input (e.g., from multiple sensors, cameras, or other data sources), the server can consume multiple streams of data, process them together, and return a single result.

Proposal

Introduce a new method signature in .proto files that allows for defining multiple request streams. For example:

service MultiStreamService {
  rpc MultiStream(stream Request1, stream Request2) returns (stream Response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants