Skip to content

Optimize the SSE delimiting of streamed messages #112

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

numanelahi
Copy link
Contributor

This PR

  • sets the default value for the introduced SSE params to avoid breaking the code for those not explicitly setting it.
  • optimizes the SSE framing of the streamed response messages

@@ -69,12 +69,12 @@ struct JsonResponseTranslateOptions {
// If set to true, newline "\n" is used to separate streaming messages.
// If set to false, all streaming messages are treated as a JSON array and
// separated by comma.
bool stream_newline_delimited;
bool stream_newline_delimited = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting a default could affect existing users. Do we need to set a default here?

Can you also add a comment that setting stream_sse_style_delimited will override/ignore this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added that to the comment on stream_sse_style_delimited.

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gopkarthik, numanelahi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [gopkarthik,numanelahi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@numanelahi numanelahi merged commit a6e226f into grpc-ecosystem:master May 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants