-
Notifications
You must be signed in to change notification settings - Fork 419
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
Add sendMessages and flush to StreamingRequestClientCall #538
Conversation
Motivation: The API for `StreamingRequestClientCall` does not make it easy for users to send a batch of messages and then flush at the end. Modifications: Add methods to `StreamingRequestClientCall` to: - send messages, and - manually flush. Result: Users can send a batch of messages and manually flush for calls which stream from the client.
Resolves #537 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have the same methods on the server as well?
Potentially, but I think it would come with a broader set of changes: at the moment there's really no control for the user in how they send messages, only I'll file another issue for this. |
Thinking about this more, what's the benefit of the extra I'm a bit worried that having both future-returning and promise-taking methods that both have a |
LGTM, save for my question about |
Hmm I see your point. We should keep the future/promise APIs. But I think we can do away with I think it's a reasonable assumption to make that most users will send a single message at a time in which case I think they'd (probably) want to flush as well. If they don't want to flush when writing a message then they can keep their own buffer of messages and then send them with The API would then be something like:
What do you think? |
Agreed.
Looks good to me :-) |
Co-Authored-By: Daniel Alm <Daniel.Alm@ForumD.net>
Motivation:
The API for
StreamingRequestClientCall
does not make it easy for usersto send a batch of messages and then flush at the end.
Modifications:
Add methods to
StreamingRequestClientCall
to:Result:
Users can send a batch of messages and manually flush for calls which
stream from the client.